Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

markokaup's avatar

Laravel Spark: json_decode(): Passing null to parameter

Hey all! Any idea what's the problem here? Just installed Laravel Spark by following installation guide, line by line, and when I try to access to billing page, I got this.

LOG.warning: json_decode(): Passing null to parameter #1 ($json) of type string is deprecated in /site_path/vendor/laravel/spark-stripe/src/Billable.php on line 148

and that Billable.php line 148 is

    /**
     * Gert the receipt emails.
     *
     * @param  mixed $value
     * @return array
     */
    public function getReceiptEmailsAttribute($value)
    {
        return json_decode($value) ?: [];
    }

What I am missing here, just can't figure this out. I am registered and logged in.

Thanks for all help!

0 likes
7 replies
Sinnbeck's avatar

Can you try (assuming this is your code)

public function getReceiptEmailsAttribute($value)
    {
        return json_decode($value ?? '[]');
    } 
markokaup's avatar

@Sinnbeck Hi! No, this is not my code, this is Spark code..

This is Billable trait from vendor/laravel/spark-stripe/src/Billable.php

Sinnbeck's avatar

@markokaup ah ok. Any chance you didn't run the migrations? Be sure that your database has that column on the users table (receipt_emails)

markokaup's avatar

@Sinnbeck Hey, all migrations is in place. users table has receipt_emails and tried (just moments go) with or without email. I've done migrations with and without Spark migration published, Spark fresh install, config un-touched. Users model have Billable trait and imported correctly (Spark\Billable).

This is killing me! :D

Sinnbeck's avatar

@markokaup weird. Can you show the users model and how that column looks in the database (it's content) ?

markokaup's avatar
markokaup
OP
Best Answer
Level 4

@Sinnbeck Okey I figure this out. Apparently if you don't have SVG in config/spark.php -> logo. it will threw this error.. Just little misleading that error tho? Yes, I was reinstalling Spark but totally forgot to remove config file and brand settings within.

Please or to participate in this conversation.