laravel中 url() route() URL::asset()

  Route::get(' $path ',' 控制器@方法');

function url($path = null, $parameters = [], $secure = null)
$path为路径,$parameters为混合型数据


Route::get(' $path ',' 控制器@方法')->name(' name ');
function route($name, $parameters = [], $absolute = true)
$name为路由别名,$parameters为数组


Route::get('/posts/{id}',' 控制器@方法')->name(' name ');
这两个方法的第二个参数都是可以给路径的上占位符一个具体的值,比如id,用来编辑修改删除数据表中id这条的记录

 

原文地址:https://www.cnblogs.com/muwu/p/8904429.html