<?php
/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
//直接调用视图模板
Route::get('/', function () {
    return view('welcome.welcome');
});
//调用控制器中的方法
Route::get('test1','PeopelController@say');
Route::get('name','User@getName');
//直接在路由中使用某个方法
Route::get('hello',function (){
    return '你好';
});
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/
Route::group(['middleware' => ['web']], function () {
    //
});

相关文章:

  • 2021-09-18
  • 2022-02-07
  • 2022-01-03
  • 2021-10-02
  • 2022-12-23
  • 2022-12-23
  • 2021-11-10
猜你喜欢
  • 2022-02-06
  • 2021-10-27
  • 2022-12-23
  • 2021-08-28
  • 2021-06-18
  • 2021-10-15
  • 2022-01-08
相关资源
相似解决方案