<?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');
});
#可以访问
//Route::get('index', function() {
// return 'Hello Laravel';
//});
//可以访问 any匹配任何网络请求
/// //Route::any('index', function() {
// return 'Hello Laravel';
//});
//同时匹配get post
//Route::match(['get', 'post'], 'index', function () {
// return 'Hello Laravel';
//});
Route::get('index/{id}', function($id) {
return 'Hello Laravel'.$id;
});
教程来自bilibili
【李炎恢】【Laravel / 核心篇 / PHP框架 / 阶段一】【十天精品课堂系列】【已完结 / 47P】_哔哩哔哩_bilibili