Is there a way to simplify these three lines to create multiple flash messages?
session()->flash('status', 'error'); session()->flash('title', 'test title'); session()->flash('message', 'test message');
I tried it but it doesn’t work
return view('panel.codes.CodeCrud.create', [ 'categories' => collect(), 'cards' => collect(), ])->with([ 'status' => 'error', 'title' => 'test title', 'message' => 'test message', ]);
P粉8521147522024-03-28 00:12:19
You can pass an array as the second parameter to session()->flash
session()->flash('status', ['status' => 'error', 'title' => 'test title']);