awesome-nova / tool-actions
Installs: 605
Dependents: 1
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 0
Open Issues: 0
Language:Vue
Requires
- php: >=7.1.0
This package is auto-updated.
Last update: 2024-10-25 09:56:33 UTC
README
Installation
You can install the package in to a Laravel app that uses Nova via composer:
composer require awesome-nova/tool-actions
Usage
class AddCommentAction extends ToolAction { public function name() { return 'Add New Comment'; } public function label() { return 'Add comment'; } public function handle(ActionFields $fields) { Comment::create([ 'comment' => $fields->get('comment') ]); } public function fields() { return [ Text::make("Comment")->rules('required') ]; } }