laravel return back with status code example
Example 1: laravel return back with success
return redirect()->back()->with('message', 'IT WORKS!');
Displaying message if it exists:
@if(session()->has('message'))
<div class="alert alert-success">
{{ session()->get('message') }}
</div>
@endif
Example 2: Redirect::route('profile') and with() in laravel
return redirect()->route('profile', [$user]);
Example 3: Redirect::route('profile') and with() in laravel
return redirect()->route('profile', ['id' => 1]);