Question By
Solved

How to use toast trough laravel controller

Solved
ngatsejacques

May 7th, 2022 01:29 PM

Hi,

It's me again, i'm coming with a new question, how can i use laravel controller to set notification with toaster ?

Typically when i save data i want to notify the user that the saving was ok.

Using popToast javsicript function work but i want to set the message from laravel

Thanks

bobbyiliev

May 8th, 2022 09:04 AM

Best Answer

Hey,

You can do that by redirecting back and passing a session message. Example:

        return back()->with(['message' => 'Successfully executed some action.', 'message_type' => 'success']);

The message type can be changed accordingly too.

Report
1