Update models.

This commit is contained in:
James Cole 2017-11-03 16:04:17 +01:00
parent a664451913
commit ac801c8b86
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
31 changed files with 115 additions and 132 deletions

View File

@ -53,15 +53,13 @@ class Account extends Model
*/
protected $casts
= [
'created_at' => 'date',
'updated_at' => 'date',
'deleted_at' => 'date',
'created_at' => 'datetime',
'updated_at' => 'datetime',
'deleted_at' => 'datetime',
'active' => 'boolean',
'encrypted' => 'boolean',
];
/** @var array */
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
/** @var array */
protected $fillable = ['user_id', 'account_type_id', 'name', 'active', 'virtual_balance', 'iban'];
/** @var array */
protected $hidden = ['encrypted'];

View File

@ -41,11 +41,10 @@ class AccountMeta extends Model
*/
protected $casts
= [
'created_at' => 'date',
'updated_at' => 'date',
'created_at' => 'datetime',
'updated_at' => 'datetime',
];
/** @var array */
protected $dates = ['created_at', 'updated_at'];
protected $fillable = ['account_id', 'name', 'data'];
protected $table = 'account_meta';

View File

@ -50,15 +50,10 @@ class AccountType extends Model
*/
protected $casts
= [
'created_at' => 'date',
'updated_at' => 'date',
'created_at' => 'datetime',
'updated_at' => 'datetime',
];
/** @var array */
protected $dates = ['created_at', 'updated_at'];
//
/**
* @return HasMany
*/

View File

@ -46,14 +46,12 @@ class Attachment extends Model
*/
protected $casts
= [
'created_at' => 'date',
'updated_at' => 'date',
'deleted_at' => 'date',
'created_at' => 'datetime',
'updated_at' => 'datetime',
'deleted_at' => 'datetime',
'uploaded' => 'boolean',
];
/** @var array */
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
/** @var array */
protected $fillable = ['attachable_id', 'attachable_type', 'user_id', 'md5', 'filename', 'mime', 'title', 'notes', 'description', 'size', 'uploaded'];
/**

View File

@ -43,15 +43,13 @@ class AvailableBudget extends Model
*/
protected $casts
= [
'created_at' => 'date',
'updated_at' => 'date',
'deleted_at' => 'date',
'created_at' => 'datetime',
'updated_at' => 'datetime',
'deleted_at' => 'datetime',
'start_date' => 'date',
'end_date' => 'date',
];
/** @var array */
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
/** @var array */
protected $fillable = ['user_id', 'transaction_currency_id', 'amount', 'start_date', 'end_date'];
/**

View File

@ -47,9 +47,9 @@ class Bill extends Model
*/
protected $casts
= [
'created_at' => 'date',
'updated_at' => 'date',
'deleted_at' => 'date',
'created_at' => 'datetime',
'updated_at' => 'datetime',
'deleted_at' => 'datetime',
'date' => 'date',
'skip' => 'int',
'automatch' => 'boolean',
@ -57,8 +57,6 @@ class Bill extends Model
'name_encrypted' => 'boolean',
'match_encrypted' => 'boolean',
];
/** @var array */
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
protected $fillable
= ['name', 'match', 'amount_min', 'match_encrypted', 'name_encrypted', 'user_id', 'amount_max', 'date', 'repeat_freq', 'skip',
'automatch', 'active',];

View File

@ -47,16 +47,17 @@ class Budget extends Model
*/
protected $casts
= [
'created_at' => 'date',
'updated_at' => 'date',
'deleted_at' => 'date',
'created_at' => 'datetime',
'updated_at' => 'datetime',
'deleted_at' => 'datetime',
'active' => 'boolean',
'encrypted' => 'boolean',
];
/** @var array */
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
/** @var array */
protected $fillable = ['user_id', 'name', 'active'];
/** @var array */
protected $hidden = ['encrypted'];
/** @var array */
protected $rules = ['name' => 'required|between:1,200',];
/**

View File

@ -41,14 +41,14 @@ class BudgetLimit extends Model
*/
protected $casts
= [
'created_at' => 'date',
'updated_at' => 'date',
'created_at' => 'datetime',
'updated_at' => 'datetime',
'start_date' => 'date',
'end_date' => 'date',
'repeats' => 'boolean',
];
/** @var array */
protected $dates = ['created_at', 'updated_at', 'start_date', 'end_date'];
protected $dates = ['start_date', 'end_date'];
/**
* @param $value

View File

@ -46,14 +46,12 @@ class Category extends Model
*/
protected $casts
= [
'created_at' => 'date',
'updated_at' => 'date',
'deleted_at' => 'date',
'created_at' => 'datetime',
'updated_at' => 'datetime',
'deleted_at' => 'datetime',
'encrypted' => 'boolean',
];
/** @var array */
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
/** @var array */
protected $fillable = ['user_id', 'name'];
/** @var array */
protected $hidden = ['encrypted'];

View File

@ -42,11 +42,9 @@ class Configuration extends Model
*/
protected $casts
= [
'created_at' => 'date',
'updated_at' => 'date',
'created_at' => 'datetime',
'updated_at' => 'datetime',
];
/** @var array */
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
protected $table = 'configuration';
/**

View File

@ -36,7 +36,8 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
class CurrencyExchangeRate extends Model
{
protected $dates = ['created_at', 'updated_at', 'date'];
/** @var array */
protected $dates = ['date'];
/**
* @return BelongsTo

View File

@ -39,11 +39,9 @@ class ExportJob extends Model
/** @var array */
protected $casts
= [
'created_at' => 'date',
'updated_at' => 'date',
'created_at' => 'datetime',
'updated_at' => 'datetime',
];
/** @var array */
protected $dates = ['created_at', 'updated_at'];
/**
* @param $value

View File

@ -44,11 +44,9 @@ class ImportJob extends Model
*/
protected $casts
= [
'created_at' => 'date',
'updated_at' => 'date',
'created_at' => 'datetime',
'updated_at' => 'datetime',
];
/** @var array */
protected $dates = ['created_at', 'updated_at'];
protected $validStatus
= [

View File

@ -43,12 +43,14 @@ class LimitRepetition extends Model
*/
protected $casts
= [
'created_at' => 'date',
'updated_at' => 'date',
'created_at' => 'datetime',
'updated_at' => 'datetime',
'startdate' => 'date',
'enddate' => 'date',
];
protected $dates = ['created_at', 'updated_at', 'startdate', 'enddate'];
/** @var array */
protected $dates = ['startdate', 'enddate'];
/** @var array */
protected $hidden = ['amount_encrypted'];
/**

View File

@ -42,9 +42,9 @@ class LinkType extends Model
*/
protected $casts
= [
'created_at' => 'date',
'updated_at' => 'date',
'deleted_at' => 'date',
'created_at' => 'datetime',
'updated_at' => 'datetime',
'deleted_at' => 'datetime',
'editable' => 'boolean',
];

View File

@ -40,11 +40,11 @@ class Note extends Model
*/
protected $casts
= [
'created_at' => 'date',
'updated_at' => 'date',
'deleted_at' => 'date',
'created_at' => 'datetime',
'updated_at' => 'datetime',
'deleted_at' => 'datetime',
];
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
/** @var array */
protected $fillable = ['title', 'text'];
/**

View File

@ -47,17 +47,20 @@ class PiggyBank extends Model
*/
protected $casts
= [
'created_at' => 'date',
'updated_at' => 'date',
'deleted_at' => 'date',
'created_at' => 'datetime',
'updated_at' => 'datetime',
'deleted_at' => 'datetime',
'startdate' => 'date',
'targetdate' => 'date',
'order' => 'int',
'active' => 'boolean',
'encrypted' => 'boolean',
];
protected $dates = ['created_at', 'updated_at', 'deleted_at', 'startdate', 'targetdate'];
/** @var array */
protected $dates = ['startdate', 'targetdate'];
/** @var array */
protected $fillable = ['name', 'account_id', 'order', 'targetamount', 'startdate', 'targetdate'];
/** @var array */
protected $hidden = ['targetamount_encrypted', 'encrypted'];
/**

View File

@ -40,11 +40,12 @@ class PiggyBankEvent extends Model
*/
protected $casts
= [
'created_at' => 'date',
'updated_at' => 'date',
'date' => 'date',
'created_at' => 'datetime',
'updated_at' => 'datetime',
'date' => 'datetime',
];
protected $dates = ['created_at', 'updated_at', 'date'];
/** @var array */
protected $dates = ['date'];
protected $fillable = ['piggy_bank_id', 'transaction_journal_id', 'date', 'amount'];
protected $hidden = ['amount_encrypted'];

View File

@ -42,13 +42,15 @@ class PiggyBankRepetition extends Model
*/
protected $casts
= [
'created_at' => 'date',
'updated_at' => 'date',
'deleted_at' => 'date',
'created_at' => 'datetime',
'updated_at' => 'datetime',
'deleted_at' => 'datetime',
'startdate' => 'date',
'targetdate' => 'date',
];
protected $dates = ['created_at', 'updated_at', 'startdate', 'targetdate'];
/** @var array */
protected $dates = ['startdate', 'targetdate'];
/** @var array */
protected $fillable = ['piggy_bank_id', 'startdate', 'targetdate', 'currentamount'];
/**

View File

@ -45,10 +45,11 @@ class Preference extends Model
*/
protected $casts
= [
'created_at' => 'date',
'updated_at' => 'date',
'created_at' => 'datetime',
'updated_at' => 'datetime',
];
protected $dates = ['created_at', 'updated_at'];
/** @var array */
protected $fillable = ['user_id', 'data', 'name', 'data'];
/**

View File

@ -41,10 +41,10 @@ class Role extends Model
*/
protected $casts
= [
'created_at' => 'date',
'updated_at' => 'date',
'created_at' => 'datetime',
'updated_at' => 'datetime',
];
protected $dates = ['created_at', 'updated_at'];
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany

View File

@ -43,15 +43,13 @@ class Rule extends Model
*/
protected $casts
= [
'created_at' => 'date',
'updated_at' => 'date',
'deleted_at' => 'date',
'created_at' => 'datetime',
'updated_at' => 'datetime',
'deleted_at' => 'datetime',
'active' => 'boolean',
'order' => 'int',
'stop_processing' => 'boolean',
];
/** @var array */
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
/**
* @param Rule $value

View File

@ -39,14 +39,12 @@ class RuleAction extends Model
*/
protected $casts
= [
'created_at' => 'date',
'updated_at' => 'date',
'created_at' => 'datetime',
'updated_at' => 'datetime',
'active' => 'boolean',
'order' => 'int',
'stop_processing' => 'boolean',
];
/** @var array */
protected $dates = ['created_at', 'updated_at'];
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo

View File

@ -42,15 +42,12 @@ class RuleGroup extends Model
*/
protected $casts
= [
'created_at' => 'date',
'updated_at' => 'date',
'deleted_at' => 'date',
'created_at' => 'datetime',
'updated_at' => 'datetime',
'deleted_at' => 'datetime',
'active' => 'boolean',
'order' => 'int',
];
/** @var array */
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
protected $fillable = ['user_id', 'order', 'title', 'description', 'active'];

View File

@ -39,14 +39,12 @@ class RuleTrigger extends Model
*/
protected $casts
= [
'created_at' => 'date',
'updated_at' => 'date',
'created_at' => 'datetime',
'updated_at' => 'datetime',
'active' => 'boolean',
'order' => 'int',
'stop_processing' => 'boolean',
];
/** @var array */
protected $dates = ['created_at', 'updated_at'];
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo

View File

@ -44,17 +44,20 @@ class Tag extends Model
* @var array
*/
protected $casts
= [
'created_at' => 'date',
'updated_at' => 'date',
'deleted_at' => 'date',
= [
'created_at' => 'datetime',
'updated_at' => 'datetime',
'deleted_at' => 'datetime',
'date' => 'date',
'zoomLevel' => 'int',
];
protected $dates = ['created_at', 'updated_at', 'date', 'deleted_at'];
/** @var array */
protected $dates = ['date'];
/** @var array */
protected $fillable = ['user_id', 'tag', 'date', 'description', 'longitude', 'latitude', 'zoomLevel', 'tagMode'];
protected $rules = ['tag' => 'required|between:1,200',];
/** @var array */
protected $rules = ['tag' => 'required|between:1,200',];
/**

View File

@ -87,14 +87,13 @@ class Transaction extends Model
*/
protected $casts
= [
'created_at' => 'date',
'updated_at' => 'date',
'deleted_at' => 'date',
'created_at' => 'datetime',
'updated_at' => 'datetime',
'deleted_at' => 'datetime',
'identifier' => 'int',
'encrypted' => 'boolean', // model does not have these fields though
'bill_name_encrypted' => 'boolean',
];
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
protected $fillable
= ['account_id', 'transaction_journal_id', 'description', 'amount', 'identifier', 'transaction_currency_id', 'foreign_currency_id',
'foreign_amount'];

View File

@ -44,12 +44,14 @@ class TransactionCurrency extends Model
*/
protected $casts
= [
'created_at' => 'date',
'updated_at' => 'date',
'deleted_at' => 'date',
'created_at' => 'datetime',
'updated_at' => 'datetime',
'deleted_at' => 'datetime',
'decimal_places' => 'int',
];
protected $dates = ['created_at', 'updated_at', 'deleted_at', 'date'];
/** @var array */
protected $dates = ['date'];
/** @var array */
protected $fillable = ['name', 'code', 'symbol', 'decimal_places'];
/**

View File

@ -53,9 +53,9 @@ class TransactionJournal extends Model
*/
protected $casts
= [
'created_at' => 'date',
'updated_at' => 'date',
'deleted_at' => 'date',
'created_at' => 'datetime',
'updated_at' => 'datetime',
'deleted_at' => 'datetime',
'date' => 'date',
'interest_date' => 'date',
'book_date' => 'date',
@ -66,7 +66,7 @@ class TransactionJournal extends Model
'completed' => 'boolean',
];
/** @var array */
protected $dates = ['created_at', 'updated_at', 'date', 'deleted_at', 'interest_date', 'book_date', 'process_date'];
protected $dates = ['date','interest_date', 'book_date', 'process_date'];
/** @var array */
protected $fillable
= ['user_id', 'transaction_type_id', 'bill_id', 'interest_date', 'book_date', 'process_date',

View File

@ -42,14 +42,15 @@ class TransactionJournalMeta extends Model
* @var array
*/
protected $casts
= [
'created_at' => 'date',
'updated_at' => 'date',
'deleted_at' => 'date',
= [
'created_at' => 'datetime',
'updated_at' => 'datetime',
'deleted_at' => 'datetime',
];
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
/** @var array */
protected $fillable = ['transaction_journal_id', 'name', 'data', 'hash'];
protected $table = 'journal_meta';
/** @var string */
protected $table = 'journal_meta';
/**
* @param $value

View File

@ -48,13 +48,11 @@ class TransactionType extends Model
*/
protected $casts
= [
'created_at' => 'date',
'updated_at' => 'date',
'deleted_at' => 'date',
'created_at' => 'datetime',
'updated_at' => 'datetime',
'deleted_at' => 'datetime',
];
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
/**
* @param string $type
*