A simple package of galleries to attach on a model
Add to composer.json
"require": {
"mixdinternet/galleries": "0.2.*"
}
ou
composer require mixdinternet/galleries
Open config/app.php
then add
Mixdinternet\Galleries\Providers\GalleriesServiceProvider::class
Open config/app.php
then add
'Gallery' => Mixdinternet\Galleries\Facades\Gallery::class
$ php artisan vendor:publish --provider="Mixdinternet\Galleries\Providers\GalleriesServiceProvider" --tag="assets"
$ php artisan vendor:publish --provider="Mixdinternet\Galleries\Providers\GalleriesServiceProvider" --tag="config"
$ composer dump-autoload
$ php artisan migrate
...
.styles([
...
'resources/assets/css/dropzonejs.css',
...
],
'public/assets/css/admin.css',
'./')
...
.scripts([
...
'resources/assets/js/dropzone.min.js',
'resources/assets/js/jquery-ui.sortable.min.js',
...
'resources/assets/js/galleries-start.js'
...
],
'public/assets/js/admin.js',
'./')
...
use Mixdinternet\Galleries\GalleriableInterface;
use Mixdinternet\Galleries\GalleriableTrait;
class Post extends Model implements GalleriableInterface
{
use GalleriableTrait;
{!! Gallery::form($post, [customGalleryName]) !!}
Post::first()->galleries([customGalleryName])->images();
Post::first()->gallery->images();