Support the ongoing development of Laravel.io →
Laravel.io Architecture
Last updated 2 years ago.
0
moderator Solution

See it as the same way the DispatchesJobs and the ValidatesRequests traits work. It adds behavior to each controller so we can send messages to the user when the next request is resolved. This is an ideal use case for a trait.

If you look at the actual trait you'll see that we're indeed adding the message to the session. But we're hiding it behind convenient helper methods.

0

I see, got ya, thank you.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Amin amin Joined 5 May 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.