mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-01-08 07:03:23 -06:00
29 lines
570 B
PHP
29 lines
570 B
PHP
<?php
|
|
|
|
|
|
class Component extends Elegant
|
|
{
|
|
public static $rules
|
|
= [
|
|
'user_id' => 'exists:users,id|required',
|
|
'name' => 'required|between:1,255',
|
|
'component_type_id' => 'required|exists:component_types,id'
|
|
];
|
|
|
|
|
|
public function componentType()
|
|
{
|
|
return $this->belongsTo('ComponentType');
|
|
}
|
|
|
|
public function transactions()
|
|
{
|
|
return $this->belongsToMany('Transaction');
|
|
}
|
|
|
|
public function user()
|
|
{
|
|
return $this->belongsTo('User');
|
|
}
|
|
|
|
}
|