rene-roscher/observable-provider

This package is abandoned and no longer maintained. No replacement package was suggested.

Simplified way to register the observers in Laravel for a model

1.0.0 2022-12-10 00:00 UTC

This package is auto-updated.

Last update: 2023-11-08 03:05:07 UTC


README

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.