Created
November 15, 2019 07:13
-
-
Save makerstorage/df83deb7ff011aac3986a10841b24074 to your computer and use it in GitHub Desktop.
Laravel simple Event
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| Event::listen('user.login', function($user) | |
| { | |
| var_dump($user->toArray()); | |
| }); | |
| Route::get('/', function() | |
| { | |
| $user = User::first(); | |
| Event::fire('user.login', $user); | |
| }); | |
| /* | |
| array (size=4) | |
| 'id' => int 1 | |
| 'email' => string '[email protected]' (length=20) | |
| 'created_at' => string '2014-07-29 10:47:33' (length=19) | |
| 'updated_at' => string '2014-07-29 10:47:33' (length=19) | |
| */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment