sample event listener and scaffolding for a module
This commit is contained in:
23
app/Events/TestEvent.php
Normal file
23
app/Events/TestEvent.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Events;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
use Illuminate\Broadcasting\InteractsWithSockets;
|
||||
|
||||
class TestEvent
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*/
|
||||
public function __construct(User $user)
|
||||
{
|
||||
$this->user = $user;
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,6 @@ class HomeController extends AppBaseController
|
||||
{
|
||||
/**
|
||||
* Show the application dashboard.
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
|
||||
@@ -13,9 +13,9 @@ class EventServiceProvider extends ServiceProvider
|
||||
* @var array
|
||||
*/
|
||||
protected $listen = [
|
||||
'App\Events\SomeEvent' => [
|
||||
/*'App\Events\TestEvent' => [
|
||||
'App\Listeners\EventListener',
|
||||
],
|
||||
],*/
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user