fixed #3
This commit is contained in:
parent
cb179c27eb
commit
4ba7734055
@ -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());
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
@ -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());
|
||||
}
|
||||
|
@ -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());
|
||||
}
|
||||
|
@ -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());
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ class Bills extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$bills = Bill::with('bill_statuses')->collect();
|
||||
$bills = Bill::with('status')->collect();
|
||||
|
||||
$status = collect(BillStatus::all()->pluck('name', 'code'))
|
||||
->prepend(trans('general.all_statuses'), '');
|
||||
|
@ -22,7 +22,7 @@ class Payments extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$payments = Payment::with('account', 'category')->collect();
|
||||
$payments = Payment::with(['account', 'category'])->collect();
|
||||
|
||||
$categories = collect(Category::enabled()->type('expense')->pluck('name', 'id'))
|
||||
->prepend(trans('categories.all'), '');
|
||||
|
@ -38,7 +38,7 @@ class Invoices extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$invoices = Invoice::with('invoice_statuses')->collect();
|
||||
$invoices = Invoice::with('status')->collect();
|
||||
|
||||
$status = collect(InvoiceStatus::all()->pluck('name', 'code'))
|
||||
->prepend(trans('general.all_statuses'), '');
|
||||
|
@ -25,7 +25,7 @@ class Revenues extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$revenues = Revenue::with('account', 'category', 'customer')->collect();
|
||||
$revenues = Revenue::with(['account', 'category', 'customer'])->collect();
|
||||
|
||||
$customers = collect(Customer::enabled()->pluck('name', 'id'))
|
||||
->prepend(trans('customer.all'), '');
|
||||
|
Loading…
x
Reference in New Issue
Block a user