mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 05:02:36 +01:00
0fbda85a59
- Removed unused uses - Type hinting for method parameters - Removed commented code - Introduced comments for classes and methods - Short array syntax
52 lines
976 B
PHP
52 lines
976 B
PHP
<?php namespace App\Http\Controllers;
|
|
|
|
use App\Models\Expense;
|
|
use App\Ninja\Repositories\ExpenseRepository;
|
|
use App\Services\ExpenseService;
|
|
|
|
class ExpenseApiController extends BaseAPIController
|
|
{
|
|
// Expenses
|
|
protected $expenseRepo;
|
|
protected $expenseService;
|
|
|
|
protected $entityType = ENTITY_EXPENSE;
|
|
|
|
public function __construct(ExpenseRepository $expenseRepo, ExpenseService $expenseService)
|
|
{
|
|
parent::__construct();
|
|
|
|
$this->expenseRepo = $expenseRepo;
|
|
$this->expenseService = $expenseService;
|
|
}
|
|
|
|
public function index()
|
|
{
|
|
$expenses = Expense::scope()
|
|
->withTrashed()
|
|
->with('client', 'invoice', 'vendor')
|
|
->orderBy('created_at','desc');
|
|
|
|
return $this->listResponse($expenses);
|
|
}
|
|
|
|
public function update()
|
|
{
|
|
//stub
|
|
|
|
}
|
|
|
|
public function store()
|
|
{
|
|
//stub
|
|
|
|
}
|
|
|
|
public function destroy()
|
|
{
|
|
//stub
|
|
|
|
}
|
|
|
|
|
|
} |