laravellaravel-8laravel-spark

Laravel Spark 11 - edit Spark source files not working anymore


Dear Sparkers/Laravellers

I am transforming an old Spark project (i believe version 6) to the latest version 11. To make some changes in the Spark PHP files, I've copied the files under vendor/laravel/spark-aurelius to a newly created folder named spark. Next, I've changed in the composer.json:

"repositories": [
    {
        "type": "composer",
        "url": "https://spark-satis.laravel.com"
    }
]

to

"repositories": [
    {
        "type": "path",
        "url": "./spark"
    }
]

Thereby notifying Laravel/Spark that it should use the files in the spark folder. Also, I've changed

    "laravel/spark-aurelius": "~11.0",

to

    "laravel/spark-aurelius": "*@dev",

Since that was something that was done in my original older Spark installation. Next, I performed a composer update (lots of changes) until it finished.

However, when I make some test changes to the routes.php in Spark/src/Http/routes.php and save them it's not working. The old routes are still used.

I've also cleared cache:

php artisan optimize:clear php artisan route:clear php artisan config:clear php artisan cache:clear php artisan view:clear

Any other tips?


Solution

  • Well, there was only step missing (not mentioned in the original documentation!). So it appears we need to remove the complete vendor folder before doing composer update.

    If you perform this task, and then go to the vendor/laravel folder and do ls -al you'll discover that the spark folder is now nicely referenced to the one that was provided:

    spark-aurelius -> ../../spark