Route::group(array('before' => 'auth'), function() { Route::get('/', function() { // Has Auth Filter }); Route::get('user/profile', function() { // Has Auth Filter }); }); 子域名路由 Laravel中的路由功能还支持通配符子域名,你可以在域名中指定通配符参数: 注册子域名路由 代码如下...
Route::get('/', function() { // Has Auth Filter }); Route::get('user/profile', function() { // Has Auth Filter }); }); 子域名路由 Laravel中的路由功能还支持通配符子域名,你可以在域名中指定通配符参数: 注册子域名路由 代码如下: Route::group(array('domain' => '{account}.myapp.com'...
在Laravel中,可以通过在Route::get方法中传递参数来实现传递参数的功能。具体的方法如下: 定义路由:在routes/web.php文件中,使用Route::get方法定义一个GET请求的路由,并指定路由的URL和处理该请求的回调函数。例如: 代码语言:txt 复制 Route::get('/user/{id}', function ($id) { // 处理请求的逻辑代...
Route::get('/get/{id}',function($id){ //配置路由生成get return 'get'.$id; }); 通过这个路由我们访问URL:/get/1212的时候,id会作为方法的参数传递进去,也就是说这里的1212会传递进去,这个方法我们可以看到输出为get1212。 同理,两个参数也可以使用这种方式,比如: Route::get('/get/{id}/{id2}...
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提示The GET method is not supported for this route. Supported methods: POST.错误,其实很简单就是配置路由的时候设置的是post,但是访问时采用的是get方式。 解决办法1:将路由改为any或者get Route::any('index', 'IndexController@index);
shshshsh2 声望
Laravel提示The GET method is not supported for this route. Supported methods: POST.错误的解决办法 解决方法:将路由改为any() Route::any('index',[AdminIndexController::class,'index']);
Laravel Cookie::get返回null Cookie::get()返回null Laravel验证返回null Laravel morphTo返回Null laravel关系返回null Laravel Auth返回null Http.get返回null Laravel Route::current()返回null Laravel雄辩关系返回null laravel:防止查询返回null Laravel的with方法返回null Laravel - Auth用户返回null Laravel hasOneThro...