foostart / package-forum
管理问题和答案
dev-main
2024-04-03 03:09 UTC
This package is auto-updated.
Last update: 2024-09-03 03:57:22 UTC
README
- @website: http://foostart.com
- @package-name: package-filemanager
- @author: Kang
- @date: 27/12/2017
- @version: 2.0
功能
- CRUD
- 将类别添加到表单中
- 语言规范
- 在表格数据上添加过滤器
- 添加令牌以防止XSRF
步骤 1: 在 config/app.php 中添加服务提供者
- Foostart\Post\PostServiceProvider::class,
- Foostart\Slideshow\SlideshowServiceProvider::class,
- Foostart\Filemanager\FilemanagerServiceProvider::class,
- Intervention\Image\ImageServiceProvider::class,
步骤 2: 在 config/app.php 中添加类别名
- 'Image' => Intervention\Image\Facades\Image::class,
- 'Input' => Illuminate\Support\Facades\Request::class,
步骤 3: 安装发布
- php artisan vendor:publish --provider="Foostart\Post\PostServiceProvider" --force
- php artisan vendor:publish --provider="Foostart\Slideshow\SlideshowServiceProvider" --force
步骤 4: 发布包的配置和资源
- php artisan vendor:publish --tag=lfm_config
- php artisan vendor:publish --tag=lfm_public
步骤 5: 清除缓存
- php artisan route:clear
- php artisan config:clear
- php artisan storage:link
步骤 6: 迁移和 Seeder
运行以下命令
- php artisan migrate
- php artisan db:seed
步骤 7: 添加用户
foostart\laravel-filemanager\src\Handlers\ConfigHandler.php
<?php
namespace Foostart\Filemanager\Handlers;
class ConfigHandler
{
public function userField()
{
//original
//return auth()->user()->id;
$auth = \App::make('authenticator');
$user = $auth->getLoggedUser();
if (empty($user)) {
return NULL;
}
return $user->id;
}
}