Laravel vite filament研究
filament官网
https://filamentphp.com/
文档
https://filamentphp.com/docs/2.x/admin/installation
https://laravel.com/docs/10.x
演示demo页面
https://demo.filamentphp.com/
基础认证
composer require laravel/breeze --dev
composer require barryvdh/laravel-debugbar --dev
composer require laravel/helpers
composer require spatie/laravel-permission //权限后台管理
composer require filament/spatie-laravel-media-library-plugin
composer require solution-forest/filament-access-management
composer require livewire/livewire
php artisan make:livewire counter
composer require mohamedsabil83/filament-forms-tinyeditor
后台翻译插件
composer require kenepa/translation-manager
调整数据库为sqlite
DB_CONNECTION=sqlite
DB_DATABASE=C:\Users\lianw\PhpstormProjects\laravel\laravue-example\database\database.sqlite
创建用户
php artisan make:filament-user
php artisan storage:link
php artisan make:filament-resource Customer
composer require doctrine/dbal --dev
- 创建model
php artisan make:model Category -m
php artisan make:model Post -m
php artisan make:model CategoryPost -m
之后要修改表结构
- 创建resource
php artisan make:filament-resource Category --generate --simple
php artisan make:filament-resource Post --generate --view
Layout
Fields
做前端的
php artisan make:component AppLayout
php artisan vendor:publish --tag=laravel-pagination
生成filament自定义的配置文件
php artisan vendor:publish --tag=filament-config
php artisan vendor:publish --tag=filament-views
Laravel 框架需要的
给modal 创建resource用的,显示用
Collection和Resource有区别,resourcecollection vs jsonresource
php artisan make:resource UserResource
php artisan make:model User
php artisan make:controller RegisterController
php artisan make:controller PostController --resource --model=Post
php artisan make:component PostItem --view
php artisan make:model TextWidget -m
php artisan make:resource v1/SongsCollection
php artisan make:resource v1/SongResource
创建request,可以补充验证输入框
php artisan make:request TestRequest