1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 15:13:29 +01:00
invoiceninja/app/Http/Controllers/ExpenseApiController.php

58 lines
1.0 KiB
PHP
Raw Normal View History

<?php namespace App\Http\Controllers;
2016-05-01 22:55:13 +02:00
use App\Models\Expense;
2016-05-16 04:30:24 +02:00
use App\Ninja\Repositories\ExpenseRepository;
use App\Ninja\Transformers\ExpenseTransformer;
use App\Services\ExpenseService;
use Utils;
use Response;
use Input;
use Auth;
class ExpenseApiController extends BaseAPIController
{
// Expenses
protected $expenseRepo;
protected $expenseService;
2016-05-01 22:55:13 +02:00
protected $entityType = ENTITY_EXPENSE;
public function __construct(ExpenseRepository $expenseRepo, ExpenseService $expenseService)
{
2016-03-02 15:36:46 +01:00
parent::__construct();
$this->expenseRepo = $expenseRepo;
$this->expenseService = $expenseService;
}
public function index()
{
$expenses = Expense::scope()
->withTrashed()
2016-05-04 13:53:27 +02:00
->with('client', 'invoice', 'vendor')
->orderBy('created_at','desc');
2016-05-02 10:38:01 +02:00
return $this->listResponse($expenses);
}
public function update()
{
//stub
}
public function store()
{
//stub
}
public function destroy()
{
//stub
}
}