Skip to content

Commit

Permalink
Exclude @handle from the registering event example
Browse files Browse the repository at this point in the history
 The current example of registering event handlers has a @handle after the name of the handler class ('App\Handlers\Events\EmailPurchaseConfirmation@handle'). If you put this in the EventServiceProvider file and run the 'event:generate' artisan command you actually get a file named 'EmailPurchaseConfirmation@handle.php' in the Handlers/Events directory with a class with the same name (which cannot happen).

 Everything is fixed if you remove the @handle. Tried it on a clean laravel project, fired the event in artisan's tinker and the event was correctly handled by the @handle method that was created automatically.
  • Loading branch information
hfingler committed Feb 23, 2015
1 parent fbec3be commit acf6281
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion events.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The `EventServiceProvider` included with your Laravel application provides a con
*/
protected $listen = [
'App\Events\PodcastWasPurchased' => [
'App\Handlers\Events\EmailPurchaseConfirmation@handle',
'App\Handlers\Events\EmailPurchaseConfirmation',
],
];

Expand Down

0 comments on commit acf6281

Please sign in to comment.