mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-31 08:17:32 -04:00 
			
		
		
		
	- 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
 | |
| 
 | |
|     }
 | |
| 
 | |
| 
 | |
| } |