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

52 lines
976 B
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\Services\ExpenseService;
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
}
}