2017-01-30 20:40:43 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
2016-06-11 04:47:26 +02:00
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
2016-09-12 17:01:14 +02:00
|
|
|
use Laracasts\Presenter\PresentableTrait;
|
2016-06-11 04:47:26 +02:00
|
|
|
|
2016-07-03 18:11:58 +02:00
|
|
|
/**
|
2017-01-30 20:40:43 +01:00
|
|
|
* Class ExpenseCategory.
|
2016-07-03 18:11:58 +02:00
|
|
|
*/
|
2016-06-11 04:47:26 +02:00
|
|
|
class ExpenseCategory extends EntityModel
|
|
|
|
{
|
|
|
|
// Expense Categories
|
|
|
|
use SoftDeletes;
|
2016-09-12 17:01:14 +02:00
|
|
|
use PresentableTrait;
|
2016-06-11 04:47:26 +02:00
|
|
|
|
2016-07-03 18:11:58 +02:00
|
|
|
/**
|
|
|
|
* @var array
|
|
|
|
*/
|
2016-06-11 04:47:26 +02:00
|
|
|
protected $fillable = [
|
|
|
|
'name',
|
|
|
|
];
|
|
|
|
|
2016-09-12 17:01:14 +02:00
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $presenter = 'App\Ninja\Presenters\EntityPresenter';
|
|
|
|
|
2016-07-06 20:35:16 +02:00
|
|
|
/**
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function getEntityType()
|
|
|
|
{
|
|
|
|
return ENTITY_EXPENSE_CATEGORY;
|
|
|
|
}
|
|
|
|
|
2016-07-03 18:11:58 +02:00
|
|
|
/**
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
|
|
*/
|
2016-06-11 04:47:26 +02:00
|
|
|
public function expense()
|
|
|
|
{
|
|
|
|
return $this->belongsTo('App\Models\Expense');
|
|
|
|
}
|
|
|
|
|
2016-07-06 20:35:16 +02:00
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getRoute()
|
|
|
|
{
|
|
|
|
return "/expense_categories/{$this->public_id}/edit";
|
|
|
|
}
|
2016-07-05 20:49:47 +02:00
|
|
|
}
|