'boolean', ]; /** * Get the currently active landing page. */ public static function getActive(): ?self { return static::where('is_active', true)->first(); } /** * Set this landing page as the active one, deactivating all others. */ public function setAsActive(): void { // Deactivate all other landing pages static::where('id', '!=', $this->id)->update(['is_active' => false]); // Activate this one $this->is_active = true; $this->save(); } /** * Deactivate this landing page. */ public function deactivate(): void { $this->is_active = false; $this->save(); } }