framework icon indicating copy to clipboard operation
framework copied to clipboard

Redirect back with $error not working

Open ThinkDevStudios opened this issue 5 years ago • 1 comments

  • Themosis Version: 2.0.2
  • WordPress Version: 5.4.2
  • PHP Version: 7.4.7

Description

After submitting a form I would like to return a response using the redirect()->back() function using the ->with(

Steps to reproduce

After deleting a customer

I would now return using redirect()->back()->with('success', 'Successfully Deleted!'); I am able to redirect back but the success message does not seem to be passed along.

Expected behavior

After returning with a response. an Alert / notification should show stating that the customer is successfully deleted.

ThinkDevStudios avatar Jul 10 '20 10:07 ThinkDevStudios

Did you check the session? The code below does seem to work for me.

@if (session('success'))
   {{ session('success') }}
@endif

I think you could just do back()->with('success', 'Successfully Deleted!'); (without the redirect) btw

robertbossaert avatar Jul 23 '20 11:07 robertbossaert