//Step 1
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class HomeController extends Controller
{
//
public function index(){
dd('stop');
}
}
// Step 2
<?php
use Illuminate\Support\Facades\Route;
// import controller here
use App\Http\Controllers\HomeController;
Route::get('/', [HomeController::class, 'index']);
4条答案
按热度按时间qni6mghb1#
根据拉瑞维尔的路线文件
您必须将路由操作作为数组传递:
ktca8awb2#
您应该创建如下路由x1c 0d1xRoute::get('/home',[HomeController::类,'索引']);
rdrgkggo3#
ukxgm1gy4#
按照说明一步一步地做,它会起作用的!!enter image description here