Working on custom route model binding

This commit is contained in:
Hillel Coren 2016-04-28 15:20:34 +03:00
parent 7aded4588b
commit 1a47598aea
2 changed files with 3 additions and 3 deletions

View File

@ -184,7 +184,7 @@ class ClientController extends BaseController
$data = [ $data = [
'client' => $client, 'client' => $client,
'method' => 'PUT', 'method' => 'PUT',
'url' => 'clients/'.$publicId, 'url' => 'clients/'.$client->public_id,
'title' => trans('texts.edit_client'), 'title' => trans('texts.edit_client'),
]; ];

View File

@ -15,8 +15,8 @@ class BaseRequest extends Request {
return $this->entity; return $this->entity;
} }
//dd($this->clients); $paramName = $this->entityType . 's';
$publicId = Input::get('public_id') ?: Input::get('id'); $publicId = $this->$paramName ?: (Input::get('public_id') ?: Input::get('id'));
if ( ! $publicId) { if ( ! $publicId) {
return null; return null;