mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-29 18:20:01 +00:00
Reimplemented forms, added an overdue fix.
This commit is contained in:
21
app/Validation/FireflyValidator.php
Normal file
21
app/Validation/FireflyValidator.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace FireflyIII\Validation;
|
||||
|
||||
use Illuminate\Validation\Validator;
|
||||
use DB;
|
||||
|
||||
class FireflyValidator extends Validator
|
||||
{
|
||||
|
||||
public function validateUniqueForUser($attribute, $value, $parameters)
|
||||
{
|
||||
$count = DB::table($parameters[0])->where($parameters[1],$value)->count();
|
||||
if($count == 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user