在Laravel 5.6的html视图中使用route()和with()

在Laravel 5.6的html视图中使用route()和with(),laravel,laravel-5,laravel-routing,Laravel,Laravel 5,Laravel Routing,对于重定向,在控制器中,我们可以这样写:- Redirect::Route('front_index')->with('RegError', 'An error occured while adding the user.'); 如何设置锚定标记的href,以便也可以发送“RegError”?说这样的话 <a href="{{route('front_index')->with('RegError', '')}}"> 实际上您不能,因为with函数用于将参数从控制器传

对于重定向,在控制器中,我们可以这样写:-

Redirect::Route('front_index')->with('RegError', 'An error occured while adding the user.');
如何设置锚定标记的
href
,以便也可以发送“RegError”?说这样的话

<a href="{{route('front_index')->with('RegError', '')}}">

实际上您不能,因为
with
函数用于将参数从控制器传递到视图,而
route
助手没有此方法。 您需要发出请求并在控制器中传递您的
RegError