2
votes

I'm using Laravel's out of the box authentication, which came with laravel 5. Basically, my AuthController is empty, and all the logic happens within the AuthenticatesAndRegistersUsers trait. Now I want to flash a message only after a user is registered. I can change the trait, but it's not recommended, and might not work on future versions of Laravel. There is a way to run my custom code from the Controller after user registers?

1
Why don't you write custom controller with your own methods and do what ever you need? - Milos Miskone Sretin
Because I need exactly what Laravel offers, it will be code duplication. Also, I won't get any updates from future versions of laravel (just like the recent update of the login throttling) - Idob

1 Answers

0
votes

Just copy the trait into your controller, Laravel will use the method in your controller instead of the trait because it's kind of inheritance, that way you won't touch the trait and you will be sure that the method of the flash message will work on any version of Laravel