Skip to content

Dispatchable relationship events

Compare
Choose a tag to compare
@chelout chelout released this 04 Apr 21:02
· 178 commits to master since this release

It is possible to fire event classes via $dispatchesEvents properties:

use Chelout\RelationshipEvents\Relationships\Concerns\HasOneEvents;
use Illuminate\Database\Eloquent\Model;

class User extends Model
{
    use HasOneEvents;

    protected $dispatchesEvents = [
        'hasOneSaved' => HasOneSaved::class,
    ];

}