mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 05:47:28 -08:00
Added model validation to custom fieldsets
This commit is contained in:
parent
ad12a5ce11
commit
6b5a0983ee
|
@ -3,6 +3,7 @@ namespace App\Models;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Gate;
|
use Gate;
|
||||||
|
use Watson\Validating\ValidatingTrait;
|
||||||
|
|
||||||
class CustomFieldset extends Model
|
class CustomFieldset extends Model
|
||||||
{
|
{
|
||||||
|
@ -12,6 +13,17 @@ class CustomFieldset extends Model
|
||||||
"name" => "required|unique:custom_fieldsets"
|
"name" => "required|unique:custom_fieldsets"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether the model should inject it's identifier to the unique
|
||||||
|
* validation rules before attempting validation. If this property
|
||||||
|
* is not set in the model it will default to true.
|
||||||
|
*
|
||||||
|
* @var boolean
|
||||||
|
*/
|
||||||
|
protected $injectUniqueIdentifier = true;
|
||||||
|
use ValidatingTrait;
|
||||||
|
|
||||||
|
|
||||||
public function fields()
|
public function fields()
|
||||||
{
|
{
|
||||||
return $this->belongsToMany('\App\Models\CustomField')->withPivot(["required","order"])->orderBy("pivot_order");
|
return $this->belongsToMany('\App\Models\CustomField')->withPivot(["required","order"])->orderBy("pivot_order");
|
||||||
|
|
Loading…
Reference in a new issue