Support the ongoing development of Laravel.io →
Input Session Forms
Last updated 2 years ago.
0

One possible workaround that I thought of is to return the redirect URL in a JSON return similar to my upload submit. Then in the JavaScript I could simply redirect. I think this may work, but I'm not sure how to get my success/warning/error messages. Can you post a flash message/variable from JavaScript? Is there a JavaScript equivalent to using ->with(...)?

JS (in complete method)

...
 			case "post":
					window.location.replace(data.url);
	 				break;
	 		}

Controller

} elseif(Input::get('post')) {
				$response = array(
					'type' => 'post',
					'url' => URL::to('/'),
					'success' => true);

	    		return Response::json($response);
...
Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

bwilbur1 bwilbur1 Joined 12 Sep 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.