. */ declare(strict_types=1); namespace FireflyIII\Models; use FireflyIII\Support\Models\ReturnsIntegerIdTrait; use Illuminate\Database\Eloquent\Casts\Attribute; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\SoftDeletes; /** * @mixin IdeHelperRecurrenceMeta */ class RecurrenceMeta extends Model { use ReturnsIntegerIdTrait; use SoftDeletes; protected $casts = [ 'created_at' => 'datetime', 'updated_at' => 'datetime', 'deleted_at' => 'datetime', 'name' => 'string', 'value' => 'string', ]; protected $fillable = ['recurrence_id', 'name', 'value']; /** @var string The table to store the data in */ protected $table = 'recurrences_meta'; public function recurrence(): BelongsTo { return $this->belongsTo(Recurrence::class); } protected function recurrenceId(): Attribute { return Attribute::make( get: static fn ($value) => (int)$value, ); } }