Alan Yong
Alan Yong

Reputation: 11

Spark is not defined

I using spark in laravel with vue.js. I add in home.blade.php and I got this error:

Uncaught ReferenceError: Spark is not defined

what I had done:

php artisan spark:install 

Upvotes: 1

Views: 548

Answers (2)

Zac Grierson
Zac Grierson

Reputation: 665

Make sure you include the script variables for spark

<script>
    window.Spark = @json(array_merge(Spark::scriptVariables(), []));
</script>

In your <head></head>

Upvotes: 1

kerrin
kerrin

Reputation: 3454

You need to either install the Spark Installer or install via Composer before you can use php artisan spark commands.

See installation info at https://spark.laravel.com/docs/5.0/installation#installation

Upvotes: 0

Related Questions