Skip to content

This Laravel Nova package allows you to manage media and media fields.

License

Notifications You must be signed in to change notification settings

global-fashion/nova-media-hub

 
 

Repository files navigation

Nova Media Hub

Latest Version on Packagist Total Downloads

This Laravel Nova package allows you to manage media and media fields.

Requirements

  • php: >=8.0
  • laravel/nova: ^4.0

Features

  • Media Hub UI in separate view
  • Media Hub field for selecting single/multiple media
  • Image optimization and multiple conversions support
  • File naming and path making customization
  • Dark mode support
  • A lot configuration options

Screenshots

Media Hub

Choose media

Installation

Install the package in a Laravel Nova project via Composer and run migrations:

# Install nova-media-hub
composer require outl1ne/nova-media-hub

# Run migrations
php artisan migrate

Register the tool with Nova in the tools() method of the NovaServiceProvider:

// in app/Providers/NovaServiceProvider.php

public function tools()
{
    return [
        // ...
        new \Outl1ne\NovaMediaHub\MediaHub
    ];
}

Usage

Fields

This package provides a field MediaHubField which allows you to select media. This saves the media as a JSON array into the database.

Example usage:

use Outl1ne\NovaMediaHub\Nova\Fields\MediaHubField;

// ...

MediaHubField::make('Media', 'media')
  ->defaultCollection('products') // Define the default collection the "Choose media" modal shows
  ->multiple(), // Define whether multiple media can be selected

Configure

The config file can be published using the following command:

php artisan vendor:publish --provider="Outl1ne\NovaMediaHub\MediaHubServiceProvider" --tag="config"

Localization

The translation file(s) can be published by using the following command:

php artisan vendor:publish --provider="Outl1ne\NovaMediaHub\MediaHubServiceProvider" --tag="translations"

Credits

License

Nova Media Hub is open-sourced software licensed under the MIT license.

About

This Laravel Nova package allows you to manage media and media fields.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vue 48.6%
  • PHP 47.3%
  • JavaScript 4.1%