1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 08:21:34 +02:00

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 = [
'client' => $client,
'method' => 'PUT',
'url' => 'clients/'.$publicId,
'url' => 'clients/'.$client->public_id,
'title' => trans('texts.edit_client'),
];

View File

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