ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# laravel 9.x 测试的 ~~~ <?php use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\App; /* |-------------------------------------------------------------------------- | 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! | */ //演示:http://demo.laravel9.com/admin/home/index Route::any("/{directory_name}/{controller}/{action}",function ($directory_name,$controller , $action){ $class_file = "\App\Http\Controllers\\" .ucfirst($directory_name). "\\" .ucfirst($controller). "Controller"; if(class_exists($class_file)) { $controlClass = App::make($class_file); return App::call([$controlClass, $action]); }else{ abort("404","not found"); } })->name("home"); ~~~ ![](https://img.kancloud.cn/1f/bb/1fbbc0bbd07347820b6e567866312954_891x496.png)