Route::get('user/profile', array('as' => 'profile', 'uses' => 'UserController@showProfile')); 现在,你可以使用路由名称来创建URL和重定向: 代码如下: $url = URL::route('profile'); $redirect = Redirect::route('profile'); 可以使用currentRouteName方法来获取当前运行的路由名称: 代码如下: $...
Route::get('user/profile', array('as' => 'profile', 'uses' => 'UserController@showProfile')); 现在,你可以使用路由名称来创建URL和重定向: 代码如下: $url = URL::route('profile'); $redirect = Redirect::route('profile'); 可以使用currentRouteName方法来获取当前运行的路由名称: 代码如下: $...
Hello, After read this threat #573 I used the following code to get the current route name. echo Route::currentRouteName(); But the result is: get patient/add. As you can see the output has the word get. I want to know if this is an erro...
Helper class for Laravel applications to get active class base on current route name(It's only detect "route name, this is enough for us."). Supported/Tested Laravel versions Laravel5.1|5.2|5.3|5.4 Requirements Laravel >= 5.1 : Laravel 5.1 or above. ...
在Laravel中,可以通过在Route::get方法中传递参数来实现传递参数的功能。具体的方法如下: 1. 定义路由:在routes/web.php文件中,使用Route::get方法定义一个GE...
shshshsh2 声望
Laravel5学习入门带参数的路由 Route::get带参数的路由 下面我们开看一下带参数的路由。带参数的路由主要用来解决不同用户访问的时候的不同需要,在URL中的输入会让程序获取到并且作为参数处理。下面我们来看一下简单的带参数的路由: Route::get('/get/{id}',function($id){ //配置路由生成get return 'get'....
Laravel提示The GET method is not supported for this route. Supported methods: POST.错误的解决办法 Laravel提示The GET method is not supported for this route. Supported methods: POST.错误,其实很简单就是配置路由的时候设置的是post,但是访问时采用的是get方式。
(CounterPage()); back:返回 Get.back(); 返回传参: Get.back(result: 'success'); 获取返回参数: var data =...(RouteGet.login); 路由传参: Get.toNamed(RouteGet.login, arguments: {"name":"aaaa"}); 也可以直接在路由别名后面跟参数,类似于...Url get 传参的方式: Get.toNamed("/...
1)routes文件下的请求类型或者前端发起的请求类型不一致 #该方法只允许get请求Route::match(['get'],'/getAdminList','AdminController@getAdminList'); 2)第二种错误是因为token验证不通过,而前端请求时未配置好header导致提示该错误 image.png 该问题源于sanctum进行Token验证时,Token错误而提示 ...