Ad

Using Route() And With() In Html View In Laravel 5.6

- 1 answer

For redirection, in controllers, we can write like this:-

Redirect::Route('front_index')->with('RegError', 'An error occured while adding the user.');

How can I set up the href of an anchor tag so that I can send the 'RegError' too? Say something like this?

<a target="_blank" rel="nofollow noreferrer" href="{{route('front_index')->with('RegError', '')}}">
Ad

Answer

actually you can't because with function is used to pass parameters from controllers to view and route helper doesn't have this method. You need to make request and in controller pass your RegError

Ad
source: stackoverflow.com
Ad