creode / nova-publishable
Utilises the Publishable Package, to create a new published field for the module.
1.2.0
2024-10-22 07:33 UTC
Requires
- php: ^7.3|^8.0
- laravel/nova: ^4.0
- pawelmysior/laravel-publishable: ^2.0|^3.0|^4.0
Requires (Dev)
- orchestra/canvas: ^8.11
README
This package provides an integration between the Laravel Publishable package and Nova.
Installation
composer require creode/nova-publishable
Usage
To use the field, you must first add the Publishable
trait to your model.
use PawelMysior\Publishable\Publishable; class Post extends Model { use Publishable; }
Then, you can add the field to your Nova resource.
use Creode\LaravelPublishable\Published; class Post extends Resource { // ... public function fields(Request $request) { return [ // ... Published::make('Published', 'published_at'), ]; } }
Publish/Unpublish Actions
This package also provides actions to publish and unpublish resources. To use these, you must add the Publishable
trait to your model as above.
Then you can add the following actions to your Nova resource.
use Creode\NovaPublishable\Actions\PublishAction; use Creode\NovaPublishable\Actions\UnpublishAction; class Post extends Resource { // ... public function actions(Request $request) { return [ // ... new PublishAction, new UnpublishAction, ]; } }
Roadmap
- Add tests with Dusk
- Improve the field by allowing the user to schedule resources by specify a publishable date via a secondary field
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.