'required|max:100|unique:maintenance_types,name,NULL,id,deleted_at,NULL', ]; protected $injectUniqueIdentifier = true; protected $fillable = ['name']; public function isDeletable(): bool { return Gate::allows('delete', $this) && ($this->deleted_at == ''); } public function maintenances() { return $this->hasMany(Maintenance::class, 'maintenance_type_id'); } public function getDisplayNameAttribute(): string { return $this->name; } }