
Here’s a dead simple way of triggering a model to show or anything really from a controller.
From a controller use session()→flash()
to setup a session value
session()->flash('show-update-orders-dialog');
Then in a blade file, check for a session matching this value:
@session('show-update-orders-dialog')
<x-update-order-dialog/>
@endsession
This way you can trigger a model when there is a matching session, this is one time. Once the session has been used if won’t render a second time.
This is incredibly simple but a powerful technique that does not require events or listeners.
Subscribe to my newsletter for the latest updates on my books and digital products.
Find posts, tutorials, and resources quickly.
Subscribe to my newsletter for the latest updates on my books and digital products.