foostart / package-post
管理帖子
2022.04.251610
2022-02-08 05:56 UTC
Requires
This package is auto-updated.
Last update: 2024-09-25 14:10:54 UTC
README
- @网站: http://foostart.com
- @包名: package-filemanager
- @作者: Kang
- @日期: 27/12/2017
- @版本: 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;
}
}