This commit is contained in:
denisdulici
2017-09-18 16:58:25 +03:00
parent cb179c27eb
commit 4ba7734055
10 changed files with 12 additions and 16 deletions

View File

@ -27,13 +27,11 @@ class Roles extends ApiController
/**
* Display the specified resource.
*
* @param int $id
* @param Role $role
* @return \Dingo\Api\Http\Response
*/
public function show($id)
public function show(Role $role)
{
$role = Role::with('permissions')->findOrFail($id);
return $this->response->item($role, new Transformer());
}

View File

@ -27,13 +27,11 @@ class Users extends ApiController
/**
* Display the specified resource.
*
* @param int $id
* @param User $user
* @return \Dingo\Api\Http\Response
*/
public function show($id)
public function show(User $user)
{
$user = User::with(['roles', 'permissions'])->findOrFail($id);
return $this->response->item($user, new Transformer());
}

View File

@ -27,7 +27,7 @@ class Bills extends ApiController
*/
public function index()
{
$bills = Bill::with('bill_statuses')->collect();
$bills = Bill::with(['vendor', 'status', 'items', 'payments', 'histories'])->collect();
return $this->response->paginator($bills, new Transformer());
}

View File

@ -19,7 +19,7 @@ class Payments extends ApiController
*/
public function index()
{
$payments = Payment::with('account', 'vendor', 'category')->collect();
$payments = Payment::with(['account', 'vendor', 'category'])->collect();
return $this->response->paginator($payments, new Transformer());
}

View File

@ -27,7 +27,7 @@ class Invoices extends ApiController
*/
public function index()
{
$invoices = Invoice::with('invoice_statuses')->collect();
$invoices = Invoice::with(['customer', 'status', 'items', 'payments', 'histories'])->collect();
return $this->response->paginator($invoices, new Transformer());
}

View File

@ -19,7 +19,7 @@ class Revenues extends ApiController
*/
public function index()
{
$revenues = Revenue::with('account', 'customer', 'category')->collect();
$revenues = Revenue::with(['account', 'customer', 'category'])->collect();
return $this->response->paginator($revenues, new Transformer());
}