所以,在Laravel,有在使用类路由一个web.php文件,它的静态函数获取和匹配称为类路径。我想了解一下web.php使用
的问题是,这个类是怎样的一个谜给我的,我无法找到它在我的laravel项目源,niether可以找到关于它的任何互联网。 如果你谷歌它,你会发现Illuminate \ Routing \ Route,但我认为这不是我正在寻找的类,因为那个没有静态函数获取和匹配。 我也试过寻找它,我的项目目录,我发现我认为这样的名称的四个类,但他们都没有这些功能,这是在我的web.php中使用。
这里是我的web.php:
<?php
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::get('/', function() {
return view('welcome');
});
Auth::routes();
Route::get('/', '[email protected]')->name('post.all');
Route::match(['get', 'post'], '/article/create', '[email protected]')->name('post.create')
->middleware('auth');
Route::get('/article/{id}', '[email protected]')->name('post.single');
Route::match(['get', 'post'], '/article/{id}/delete', '[email protected]')->name('post.delete')
->middleware('auth', 'author');
Route::match(['get', 'post'], '/article/{id}/edit', '[email protected]')->name('post.edit')
->middleware('auth', 'author');
Route::get('/author/{id}', '[email protected]')->name('post.author');
Route::get('/category/{id}', '[email protected]')->name('post.category');
Route::match(['get', 'post'], '/user/create', '[email protected]')->name('user.create')
->middleware('auth');
Route::get('/home', '[email protected]');