mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 20:22:42 +01:00
63ea0a00d4
Without the presentable trait and at the basic level a default EntityPresenter, adding Expense Categories breaks when trying to view the edit page for the expense.
52 lines
909 B
PHP
52 lines
909 B
PHP
<?php namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
use Laracasts\Presenter\PresentableTrait;
|
|
|
|
/**
|
|
* Class ExpenseCategory
|
|
*/
|
|
class ExpenseCategory extends EntityModel
|
|
{
|
|
// Expense Categories
|
|
use SoftDeletes;
|
|
use PresentableTrait;
|
|
|
|
/**
|
|
* @var array
|
|
*/
|
|
protected $fillable = [
|
|
'name',
|
|
];
|
|
|
|
/**
|
|
* @var string
|
|
*/
|
|
protected $presenter = 'App\Ninja\Presenters\EntityPresenter';
|
|
|
|
/**
|
|
* @return mixed
|
|
*/
|
|
public function getEntityType()
|
|
{
|
|
return ENTITY_EXPENSE_CATEGORY;
|
|
}
|
|
|
|
/**
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
*/
|
|
public function expense()
|
|
{
|
|
return $this->belongsTo('App\Models\Expense');
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getRoute()
|
|
{
|
|
return "/expense_categories/{$this->public_id}/edit";
|
|
}
|
|
|
|
}
|