sample event listener and scaffolding for a module

This commit is contained in:
Nabeel Shahzad
2017-12-02 09:19:58 -06:00
parent b14f4355da
commit df2b092d60
15 changed files with 143 additions and 38 deletions

23
app/Events/TestEvent.php Normal file
View 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;
}
}

View File

@@ -8,7 +8,6 @@ class HomeController extends AppBaseController
{
/**
* Show the application dashboard.
* @return \Illuminate\Http\Response
*/
public function index()
{

View File

@@ -13,9 +13,9 @@ class EventServiceProvider extends ServiceProvider
* @var array
*/
protected $listen = [
'App\Events\SomeEvent' => [
/*'App\Events\TestEvent' => [
'App\Listeners\EventListener',
],
],*/
];
/**