Merge branch 'master' of https://github.com/akaunting/akaunting
This commit is contained in:
commit
2d9bd5f540
@ -27,13 +27,11 @@ class Roles extends ApiController
|
|||||||
/**
|
/**
|
||||||
* Display the specified resource.
|
* Display the specified resource.
|
||||||
*
|
*
|
||||||
* @param int $id
|
* @param Role $role
|
||||||
* @return \Dingo\Api\Http\Response
|
* @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());
|
return $this->response->item($role, new Transformer());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,12 +27,17 @@ class Users extends ApiController
|
|||||||
/**
|
/**
|
||||||
* Display the specified resource.
|
* Display the specified resource.
|
||||||
*
|
*
|
||||||
* @param int $id
|
* @param int|string $id
|
||||||
* @return \Dingo\Api\Http\Response
|
* @return \Dingo\Api\Http\Response
|
||||||
*/
|
*/
|
||||||
public function show($id)
|
public function show($id)
|
||||||
{
|
{
|
||||||
$user = User::with(['roles', 'permissions'])->findOrFail($id);
|
// Check if we're querying by id or email
|
||||||
|
if (is_numeric($id)) {
|
||||||
|
$user = User::with(['roles', 'permissions'])->findOrFail($id);
|
||||||
|
} else {
|
||||||
|
$user = User::with(['roles', 'permissions'])->where('email', $id)->first();
|
||||||
|
}
|
||||||
|
|
||||||
return $this->response->item($user, new Transformer());
|
return $this->response->item($user, new Transformer());
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ class Bills extends ApiController
|
|||||||
*/
|
*/
|
||||||
public function index()
|
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());
|
return $this->response->paginator($bills, new Transformer());
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ class Payments extends ApiController
|
|||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$payments = Payment::with('account', 'vendor', 'category')->collect();
|
$payments = Payment::with(['account', 'vendor', 'category'])->collect();
|
||||||
|
|
||||||
return $this->response->paginator($payments, new Transformer());
|
return $this->response->paginator($payments, new Transformer());
|
||||||
}
|
}
|
||||||
|
@ -27,11 +27,18 @@ class Vendors extends ApiController
|
|||||||
/**
|
/**
|
||||||
* Display the specified resource.
|
* Display the specified resource.
|
||||||
*
|
*
|
||||||
* @param Vendor $vendor
|
* @param int|string $id
|
||||||
* @return \Dingo\Api\Http\Response
|
* @return \Dingo\Api\Http\Response
|
||||||
*/
|
*/
|
||||||
public function show(Vendor $vendor)
|
public function show($id)
|
||||||
{
|
{
|
||||||
|
// Check if we're querying by id or email
|
||||||
|
if (is_numeric($id)) {
|
||||||
|
$vendor = Vendor::findOrFail($id);
|
||||||
|
} else {
|
||||||
|
$vendor = Vendor::where('email', $id)->first();
|
||||||
|
}
|
||||||
|
|
||||||
return $this->response->item($vendor, new Transformer());
|
return $this->response->item($vendor, new Transformer());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,11 +27,18 @@ class Customers extends ApiController
|
|||||||
/**
|
/**
|
||||||
* Display the specified resource.
|
* Display the specified resource.
|
||||||
*
|
*
|
||||||
* @param Customer $customer
|
* @param int|string $id
|
||||||
* @return \Dingo\Api\Http\Response
|
* @return \Dingo\Api\Http\Response
|
||||||
*/
|
*/
|
||||||
public function show(Customer $customer)
|
public function show($id)
|
||||||
{
|
{
|
||||||
|
// Check if we're querying by id or email
|
||||||
|
if (is_numeric($id)) {
|
||||||
|
$customer = Customer::findOrFail($id);
|
||||||
|
} else {
|
||||||
|
$customer = Customer::where('email', $id)->first();
|
||||||
|
}
|
||||||
|
|
||||||
return $this->response->item($customer, new Transformer());
|
return $this->response->item($customer, new Transformer());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ class Invoices extends ApiController
|
|||||||
*/
|
*/
|
||||||
public function index()
|
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());
|
return $this->response->paginator($invoices, new Transformer());
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ class Revenues extends ApiController
|
|||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$revenues = Revenue::with('account', 'customer', 'category')->collect();
|
$revenues = Revenue::with(['account', 'customer', 'category'])->collect();
|
||||||
|
|
||||||
return $this->response->paginator($revenues, new Transformer());
|
return $this->response->paginator($revenues, new Transformer());
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ class Bills extends Controller
|
|||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$bills = Bill::with('bill_statuses')->collect();
|
$bills = Bill::with('status')->collect();
|
||||||
|
|
||||||
$status = collect(BillStatus::all()->pluck('name', 'code'))
|
$status = collect(BillStatus::all()->pluck('name', 'code'))
|
||||||
->prepend(trans('general.all_statuses'), '');
|
->prepend(trans('general.all_statuses'), '');
|
||||||
|
@ -22,7 +22,7 @@ class Payments extends Controller
|
|||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$payments = Payment::with('account', 'category')->collect();
|
$payments = Payment::with(['account', 'category'])->collect();
|
||||||
|
|
||||||
$categories = collect(Category::enabled()->type('expense')->pluck('name', 'id'))
|
$categories = collect(Category::enabled()->type('expense')->pluck('name', 'id'))
|
||||||
->prepend(trans('categories.all'), '');
|
->prepend(trans('categories.all'), '');
|
||||||
|
@ -38,7 +38,7 @@ class Invoices extends Controller
|
|||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$invoices = Invoice::with('invoice_statuses')->collect();
|
$invoices = Invoice::with('status')->collect();
|
||||||
|
|
||||||
$status = collect(InvoiceStatus::all()->pluck('name', 'code'))
|
$status = collect(InvoiceStatus::all()->pluck('name', 'code'))
|
||||||
->prepend(trans('general.all_statuses'), '');
|
->prepend(trans('general.all_statuses'), '');
|
||||||
|
@ -25,7 +25,7 @@ class Revenues extends Controller
|
|||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$revenues = Revenue::with('account', 'category', 'customer')->collect();
|
$revenues = Revenue::with(['account', 'category', 'customer'])->collect();
|
||||||
|
|
||||||
$customers = collect(Customer::enabled()->pluck('name', 'id'))
|
$customers = collect(Customer::enabled()->pluck('name', 'id'))
|
||||||
->prepend(trans('customer.all'), '');
|
->prepend(trans('customer.all'), '');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user