#Laravel Spark Stuck At Subscribe Screen

2 messages · Page 1 of 1 (latest)

peak adder
#

I'm stuck on this screen with laravel spark / paddle Webhooks work and I am successfully creating a subscription and paying for it in the sandbox, however I am unabel to see cancel / change plans views on my end.

Their support is super slow. They mentioned it's partially received data, however when I purchase the subscription paddle webhooks successfully send notifications into my local environment (to ngrok). Meaning my auth keys and everything else is correct.

#

my SparkServiceProvider.php is

use App\Models\User;
use Illuminate\Http\Request;
use Illuminate\Support\ServiceProvider;
use Illuminate\Validation\ValidationException;
use Spark\Plan;
use Spark\Spark;


class SparkServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     */
    public function boot(): void
    {
        Spark::billable(User::class)->resolve(function (Request $request) {
            return $request->user();
        });

        Spark::billable(User::class)->authorize(function (User $billable, Request $request) {
            return $request->user() &&
                   $request->user()->id == $billable->id;
        });

        Spark::billable(User::class)->checkPlanEligibility(function (User $billable, Plan $plan) {
            // if ($billable->projects > 5 && $plan->name == 'Basic') {
            //     throw ValidationException::withMessages([
            //         'plan' => 'You have too many projects for the selected plan.'
            //     ]);
            // }
        });
    }
}