Skip to content

Latest commit

 

History

History
45 lines (31 loc) · 1.16 KB

README.md

File metadata and controls

45 lines (31 loc) · 1.16 KB

Simplified way to register the observers in Laravel for a model

Latest Version on Packagist Total Downloads


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.