change the validation
This commit is contained in:
@@ -6,6 +6,7 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphToMany;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
|
||||
class RoadPatrol extends Model
|
||||
{
|
||||
@@ -13,6 +14,13 @@ class RoadPatrol extends Model
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
protected function stopPoints(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn ($value) => $value ? json_decode($value) : null,
|
||||
);
|
||||
}
|
||||
|
||||
public function observedItems(): HasMany
|
||||
{
|
||||
return $this->hasMany(ObservedItem::class);
|
||||
|
||||
Reference in New Issue
Block a user