pratik007kumar / slider
使用 slick slider js 插件实现的完整功能的 laravel slider
v1.01
2017-07-14 12:28 UTC
Requires
- php: >=5.6.4
- barryvdh/laravel-elfinder: ^0.3.10
- laravelcollective/html: ^5.4.0
This package is not auto-updated.
Last update: 2024-09-20 20:05:52 UTC
README
Laravel 5.4 图片滑动器
以下是配置图片滑动器的步骤
步骤 1:使用 composer 复制 vendor
composer require pratik007kumar/slider
or
"require": {
"pratik007kumar/slider": "dev-master"
}
composer update
步骤 2:将 providers 复制到 config/app.php
'providers' => [
// ...
Collective\Html\HtmlServiceProvider::class,
Pratik\Slider\SliderServiceProvider::class,
Barryvdh\Elfinder\ElfinderServiceProvider::class,
// ...
]
'aliases' => [
// ...
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
'Input' => Illuminate\Support\Facades\Input::class,
// ...
],
步骤 3:运行
php artisan vendor:publish
步骤 4:运行
php artisan elfinder:publish
步骤 5:运行
php artisan migrate
步骤 6:创建 public/uploads 文件夹并设置权限 0777
步骤 7:将以下数组复制到 config/elfinder.php
'dir' => ['uploads'],
'route' => [
'prefix' => 'elfinder',
'middleware' => ['web', 'auth'], //Set to null to disable middleware filter
],
'roots' => array(
array(
'driver' => 'LocalFileSystem',
'path' => __DIR__.'/../public/uploads',
'URL' => './../../uploads', // <-- That dir should be same as above, in path
'attributes' => array(
array(
'pattern' => '/\/\./',
'read' => false,
'write' => false,
'locked' => true,
'hidden' => true
)
)
)
),
'options' => array(
'accessControl' => 'access',
'uploadAllow' => ['image'],
'mimeDetect' => 'internal',
'imgLib' => 'gd',
'uploadOrder'=> ['allow', 'deny'],
'tmbPath' => '.tmb'
),
此包需要 Auth 登录,如果您没有 Auth 登录
php artisan make:auth
php artisan migrate
您可以通过 config/slider.php 修改路由前缀
'slider_route_prefix' => 'admin',
您可以通过以下链接查看 Laravel 滑动器
www.yourdomain.com/admin/slider 或 localhost/yourapp/admin/slider