Files
firefly-iii/app/models/Component.php

38 lines
1.1 KiB
PHP
Raw Normal View History

<?php
use Carbon\Carbon;
use FireflyIII\Shared\SingleTableInheritanceEntity;
2014-12-06 12:12:55 +01:00
use Illuminate\Database\Eloquent\SoftDeletingTrait;
use Watson\Validating\ValidatingTrait;
2014-12-13 21:59:02 +01:00
/**
* Class Component
*/
2014-12-17 20:47:46 +01:00
class Component extends Eloquent
{
public static $rules
2014-11-18 09:47:50 +01:00
= [
'user_id' => 'exists:users,id|required',
'name' => 'required|between:1,100|alphabasic',
'class' => 'required',
];
2014-12-06 12:12:55 +01:00
protected $dates = ['deleted_at', 'created_at', 'updated_at'];
2014-12-17 20:47:46 +01:00
protected $fillable = ['name', 'user_id','class'];
2014-11-12 22:37:44 +01:00
protected $table = 'components';
2014-12-16 21:41:16 +01:00
use ValidatingTrait;
2014-12-17 20:47:46 +01:00
// /**
// * remove this method in favour of something in the FireflyIII libraries.
// *
// * @return Carbon
// */
// public function lastActionDate()
// {
// $transaction = $this->transactionjournals()->orderBy('updated_at', 'DESC')->first();
// if (is_null($transaction)) {
// return null;
// }
//
// return $transaction->date;
// }
}