*/ use HasFactory; /** * Get the attributes that should be cast. * * @return array */ protected function casts(): array { return [ 'workspace_type' => WorkspaceType::class, 'amount' => 'integer', 'seat_limit' => 'integer', 'max_folders' => 'integer', 'max_folder_depth' => 'integer', 'max_notes_per_folder' => 'integer', 'note_chars' => 'integer', 'sort_order' => 'integer', 'is_active' => 'boolean', ]; } /** * @return HasMany */ public function organizations(): HasMany { return $this->hasMany(Organization::class); } /** * Determine whether the plan can be sold, that is, it has a Stripe price. */ public function isPurchasable(): bool { return is_string($this->stripe_price) && $this->stripe_price !== ''; } }