mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Some more code to facilitate creating your very first account.
This commit is contained in:
@@ -1,9 +1,14 @@
|
||||
<?php
|
||||
|
||||
|
||||
class Account extends Eloquent
|
||||
class Account extends Elegant
|
||||
{
|
||||
|
||||
public static $rules
|
||||
= [
|
||||
'name' => 'required|between:100,100',
|
||||
];
|
||||
|
||||
public function accountType()
|
||||
{
|
||||
return $this->belongsTo('AccountType');
|
||||
|
||||
@@ -4,12 +4,15 @@
|
||||
class Elegant extends Eloquent
|
||||
{
|
||||
public static $rules = [];
|
||||
public $validator;
|
||||
|
||||
public function isValid()
|
||||
{
|
||||
return Validator::make(
|
||||
$validator = Validator::make(
|
||||
$this->toArray(),
|
||||
$this::$rules
|
||||
)->passes();
|
||||
);
|
||||
$this->validator = $validator;
|
||||
return $validator->passes();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user