*/ use HasFactory; protected $fillable = [ 'name', 'slug', 'title', 'images_path', 'is_public', 'allow_ai_styles', 'allow_print', 'require_password', 'password_hash', 'expires_at', 'access_duration_minutes', 'upload_enabled', 'upload_token_hash', 'upload_token_expires_at', ]; protected function casts(): array { return [ 'is_public' => 'bool', 'allow_ai_styles' => 'bool', 'allow_print' => 'bool', 'require_password' => 'bool', 'expires_at' => 'datetime', 'access_duration_minutes' => 'int', 'upload_enabled' => 'bool', 'upload_token_expires_at' => 'datetime', ]; } public function images(): HasMany { return $this->hasMany(Image::class); } public function setUploadToken(string $token): void { $this->upload_token_hash = \Illuminate\Support\Facades\Hash::make($token); } public function regenerateUploadToken(): string { $token = \Illuminate\Support\Str::random(40); $this->setUploadToken($token); $this->save(); return $token; } }