$shops * * @method static \Database\Factories\PickupExceptionFactory factory($count = null, $state = []) * * @mixin \Eloquent */ #[Fillable([ 'date', 'label', 'repeatable', 'repeat_frequency', ])] #[Guarded([ 'auto_updated', ])] class PickupException extends Model { /** @use HasFactory<\Database\Factories\PickupExceptionFactory> */ use HasFactory; use HasUuidV7AsPrimaryKey; public function getId(): PickupExceptionId { return new PickupExceptionId(Uuid::fromString($this->id)); } public function setAsManuallySaved(): void { $this->setAttribute('auto_updated', false); } /** * Format a date */ #[\Override] protected function serializeDate(DateTimeInterface $date): string { return $date->format('Y-m-d'); } /** @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<\App\Models\Shop,$this,\App\Models\ShopPickupExceptionPivot> */ public function shops(): BelongsToMany { return $this->belongsToMany(Shop::class, 'shop_pickup_exception') ->using(ShopPickupExceptionPivot::class) ->withPivot(['replacement_date', 'order_deadline_at']); } #[\Override] protected function casts(): array { return [ 'date' => 'date', 'repeatable' => 'bool', 'auto_updated' => 'bool', 'repeat_frequency' => RepeatFrequency::class, ]; } }