mixdinternet/galleries
Composer 安装命令:
composer require mixdinternet/galleries
包简介
A simple gallery package
README 文档
README
A simple package of galleries to attach on a model
Installation
Add to composer.json
"require": { "mixdinternet/galleries": "0.2.*" }
ou
composer require mixdinternet/galleries
Service Provider
Open config/app.php then add
Mixdinternet\Galleries\Providers\GalleriesServiceProvider::class
Facades
Open config/app.php then add
'Gallery' => Mixdinternet\Galleries\Facades\Gallery::class
Publishing the files
$ php artisan vendor:publish --provider="Mixdinternet\Galleries\Providers\GalleriesServiceProvider" --tag="assets"
$ php artisan vendor:publish --provider="Mixdinternet\Galleries\Providers\GalleriesServiceProvider" --tag="config"
Running migrations
$ composer dump-autoload
$ php artisan migrate
Merge css/javascript into your gulpfile.js
...
.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',
'./')
...
Attaching the gallery to your model
use Mixdinternet\Galleries\GalleriableInterface;
use Mixdinternet\Galleries\GalleriableTrait;
class Post extends Model implements GalleriableInterface
{
use GalleriableTrait;
Load the grid in your panel
{!! Gallery::form($post, [customGalleryName]) !!}
Lists all images from a model
Post::first()->galleries([customGalleryName])->images();
If you want to return the default gallery images
Post::first()->gallery->images();
统计信息
- 总下载量: 1.06k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-02-24