I\'m trying to get a success message back to my home page on laravel.
return redirect()->back()->withSuccess(\'IT WORKS!\');
For some
You can simply use back() function to redirect no need to use redirect()->back() make sure you are using 5.2 or greater than 5.2 version.
You can replace your code to below code.
return back()->with('message', 'WORKS!');
In the view file replace below code.
@if(session()->has('message'))
{{ session()->get('message') }}
@endif
For more detail, you can read here
back() is just a helper function. It's doing the same thing as redirect()->back()