Reputation: 11
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;
}
I want to write adressInformation via route => firstly
route:get('person/{id}/edit','PersonController@edit')
worked then
route:get('person/{id}/edit/adressinformation'
write data
public adressInformation($id){
// TO DO vs
return $information;
}
Upvotes: 1
Views: 52
Reputation: 778
You always should defining your custom route before resource route:
Route:get('person/{id}/edit/adressinformation','PersonController@adressInformation');
Route:resource('person','PersonController');
Upvotes: 1