Route:resource('person','PersonController');
// In Actually => Person Data Edit route:get('person/{id}/edit','PersonController@edit');
public $adressInformation = '';
public function edit($id)
{
$persons = Person::find($id);
//TODO...
$this->adressInformation = $person->ADDRESS;
}
public adressInformation(){
// TO DO vs
return $information;
}
我想通过route =>写adressInformation;首先
那时route:get('person/{id}/edit','PersonController@edit')
工作了
route:get('person/{id}/edit/adressinformation'
写数据
public adressInformation($id){
// TO DO vs
return $information;
}
答案 0 :(得分:1)
您总是应该在资源路由之前定义自定义路由:
Route:get('person/{id}/edit/adressinformation','PersonController@adressInformation');
Route:resource('person','PersonController');