Skip to content

Rene-Roscher/observable-provider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Simplified way to register the observers in Laravel for a model

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages