settings = $settings; $this->gate = $gate; } /** * Human-readable label shown in the Extensions UI. */ abstract public function label(): string; /** * Whether the admin has turned this extension on via settings. */ protected function isEnabled(): bool { $key = 'ext_' . str_replace( '-', '_', $this->slug() ) . '_enabled'; return (bool) $this->settings->get( $key ); } /** * Convenience wrapper: returns a setting value for this extension. * * @param string $key Setting key suffix, e.g. "api_key" → reads "ext_{slug}_api_key". */ protected function getSetting( string $key ) { $full_key = 'ext_' . str_replace( '-', '_', $this->slug() ) . '_' . $key; return $this->settings->get( $full_key ); } }