filamentphp/filament · error · LogicException

Laravel Spark is not installed.

Error message

Laravel Spark is not installed.

What it means

Error "Laravel Spark is not installed." thrown in filamentphp/filament.

Source

Thrown at packages/spark-billing-provider/src/SparkBillingProvider.php:24

use Filament\Billing\Providers\Http\Middleware\VerifySparkBillableIsSubscribed;
use Filament\Facades\Filament;
use Illuminate\Http\RedirectResponse;
use LogicException;
use Spark\Spark;

class SparkBillingProvider implements Contracts\BillingProvider
{
    /**
     * @return string | Closure | array<class-string, string>
     */
    public function getRouteAction(): string | Closure | array
    {
        return function (): RedirectResponse {
            // We cannot explicitly require Spark through Composer, as Stripe
            // and Paddle integrations have different packages associated
            // with them. As such, we must check if this class exists.
            if (! class_exists(Spark::class)) {
                throw new LogicException('Laravel Spark is not installed.');
            }

            $tenant = Filament::getTenant();

            return redirect()->route('spark.portal', [
                'id' => $tenant->getKey(),
                'type' => (fn (): string => $this->type)->call(Spark::billable($tenant::class)),
            ]);
        };
    }

    public function getSubscribedMiddleware(): string
    {
        return VerifySparkBillableIsSubscribed::class;
    }
}

View on GitHub (pinned to 53483fa934)

When it happens

Trigger: Thrown at packages/spark-billing-provider/src/SparkBillingProvider.php:24 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of filamentphp/filament@53483fa934 (2026-08-17). Data as JSON: /api/errors/2e4e260eeb52da2b. Report an issue: GitHub.