This commit is contained in:
Bozhidar Slaveykov 2024-04-01 19:40:13 +03:00
parent 06bb4ab096
commit 6a4c37fd77
3 changed files with 36 additions and 2 deletions

View file

@ -21,6 +21,8 @@ class ModelWebsiteCreatingListener
*/
public function handle(ModelWebsiteCreating $event): void
{
//
dd($event);
}
}

View file

@ -0,0 +1,26 @@
<?php
namespace App\Listeners;
use App\Events\ModelWebsiteDeleting;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
class ModelWebsiteDeletingListener
{
/**
* Create the event listener.
*/
public function __construct()
{
//
}
/**
* Handle the event.
*/
public function handle(ModelWebsiteDeleting $event): void
{
// dd($event);
}
}

View file

@ -2,6 +2,11 @@
namespace App\Providers;
use App\Events\ModelWebsiteCreating;
use App\Events\ModelWebsiteDeleting;
use App\Listeners\ModelWebsiteCreatingListener;
use App\Listeners\ModelWebsiteDeletingListener;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
@ -19,6 +24,7 @@ class AppServiceProvider extends ServiceProvider
*/
public function boot(): void
{
//
Event::listen(ModelWebsiteCreating::class,ModelWebsiteCreatingListener::class);
Event::listen(ModelWebsiteDeleting::class,ModelWebsiteDeletingListener::class);
}
}