rene-roscher / observable-provider
Simplified way to register the observers in Laravel for a model
Installs: 2 209
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^8.0|^7.4
- illuminate/contracts: ^8.37|^9.4|^10.0
Requires (Dev)
- nunomaduro/collision: ^5.3|^6.1
- orchestra/testbench: ^6.15|^7.15
README
With this package, you should be able to register your observers more easily. Quite simply through the key -> value principle.
Installation
You can install the package via composer:
composer require rene-roscher/observable-provider
Usage
<?php namespace App\Providers; use App\Models\User; use App\Observers\UserObserver; use Xepare\ObservableProvider as ServiceProvider; class ObserverServiceProvider extends ServiceProvider { /** * The observer mappings for the application. * * @var array */ protected array $observables = [ User::class => UserObserver::class, ]; }
License
The MIT License (MIT). Please see License File for more information.