think.studio / nova-forms-entries
Nova 助手,用于实现 laravel-forms-entries 包。
2.3.0
2023-09-10 12:40 UTC
Requires
- php: ^8.1
- laravel/nova: ^4.0
- think.studio/laravel-forms-entries: ^3.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.21
- orchestra/testbench: ^8.5
- phpunit/phpunit: ^10.2
- psalm/plugin-laravel: ^2.8
- vimeo/psalm: ^5.13
README
Nova 助手,用于实现 laravel-forms-entries 包。
安装
通过 composer 安装此包
composer require think.studio/nova-forms-entries
使用方法
use App\Nova\Resource; use App\Nova\Resources\Staff; use App\Nova\Resources\Contact; use NovaFormEntries\FormEntryResource; class FormEntry extends Resource { use FormEntryResource; /** * The model the resource corresponds to. */ public static $model = \FormEntries\Models\FormEntry::class; /** * The single value that should be used to represent the resource when being displayed. */ public static $title = 'name'; /** * The columns that should be searched. * * @var array */ public static $search = [ 'created_at', 'type', 'id', ]; public function senderTypes(): array { return [ Contact::class, Staff::class, ]; } }