wamesk / laravel-reviews
package create Reviews table, model, observer
0.3
2023-11-14 10:32 UTC
Requires
README
Preview
Usage
(register provider only if not auto registred Wame\Review\ReviewServiceProvider::class, )
- vendor publish -- reviewServiceProvider
php artisan vendor:publish --provider="Wame\Review\ReviewServiceProvider"
- migrate
php artisan migrate,
- add EventServiceProvieder for observer nad listeners
/** * The event to listener mappings for the application. */ protected $listen = [ ReviewCreatingEvent::class => [RunReviewCreatingListenerJob::class], ReviewUpdatingEvent::class => [RunReviewUpdatingListenerJob::class], ReviewUpdatedEvent::class => [RunReviewUpdatedListenerJob::class], ]; /** * Register any events for your application. */ public function boot(): void { Review::observe(ReviewObserver::class); }
- add to Nova menu
MenuItem::resource(Review::class),
- set types Models or edit label colors in
config/reviews.php
'types' => [ User::class, Order::class, ], 'status_use' => true,
- edit translates
resources/lang/sk/reviews.php
"waiting" => "čakajúci", "approved" => "schválený", "denied" => "zamietnutý", "finished" => "hotové", "edit" => "upraviť",