PLATFORM
  • Tails

    Create websites with TailwindCSS

  • Blocks

    Design blocks for your website

  • Wave

    Start building the next great SAAS

  • Pines

    Alpine & Tailwind UI Library

  • Auth

    Plug'n Play Authentication for Laravel

  • Designer comingsoon

    Create website designs with AI

  • DevBlog comingsoon

    Blog platform for developers

  • Static

    Build a simple static website

  • SaaS Adventure

    21-day program to build a SAAS

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