-1

I am trying to install laravel Spark but getting a lot of errors no matter which method I try.

Upon adding "laravel/spark": "*@dev" in the composer.js file I am getting this error.

The requested package laravel/spark could not be found in any version, there may be a typo in the package name.

Any clue what the issue is?

"require": {
  "php": ">=5.5.9",
  "laravel/framework": "5.2.",
  "laravel/cashier": "~6.0",
  "laravel/spark": "@dev"
}

Added to the composer.js file and ran composer update. Got the couldn't found error.

linuxartisan
  • 2,396
  • 3
  • 21
  • 40
Karan S
  • 55
  • 1
  • 1
  • 5

1 Answers1

0

In your composer.json file, add the following to the require section (note that, compared to what you currently listed, this one has an asterisk * before the @ symbol):

"laravel/spark": "*@dev"

Then add this in its own section (or update accordingly):

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

The options portion is optional and you can leave it out

You can then run your composer install command. You can confirm that things are good by running composer validate, which will trigger a warning and it's fine to ignore that. You should also check the composer.lock file to make sure you have something similar to this in there:

{
    "name": "laravel/spark",
    "version": "dev-develop",
    "dist": {
        "type": "path",
        "url": "./spark",
        "reference": "072b0bf217fbbe5018fc062612bb1fb5566d94e1",
        "shasum": null
    },
    "require": {
        "erusev/parsedown": "~1.0",
        "firebase/php-jwt": "~3.0|~4.0",
        "guzzlehttp/guzzle": "~6.0",
        "intervention/image": "^2.3",
        "php": ">=5.5.9",
        "ramsey/uuid": "^3.1"
    },
    "require-dev": {
        "mockery/mockery": "0.9.*",
        "mpociot/vat-calculator": "^1.6",
        "phpunit/phpunit": "~5.0"
    },
    "type": "library",
    "extra": {
        "branch-alias": {
            "dev-master": "4.0-dev"
        }
    },
    "autoload": {
        "psr-4": {
            "Laravel\\Spark\\": "src/"
        }
    },
    "license": [
        "MIT"
    ],
    "authors": [
        {
            "name": "Taylor Otwell",
            "email": "taylorotwell@gmail.com"
        }
    ],
    "description": "Laravel Spark provides scaffolding for Laravel SaaS applications.",
    "keywords": [
        "billing",
        "laravel",
        "saas",
        "scaffolding",
        "stripe"
    ],
    "transport-options": {
        "symlink": false
    }
},

Also, depending on your version and how you set things up, you'll have to check on the documentation because there's a few different ways to set this up:

https://spark.laravel.com/docs/6.0/installation#installation-via-composer

I'd also add that, you should never modify files in the ./spark directory. All changes are made in either ./resources/assets/js/spark or ./resources/views/vendor/spark (and, as always, you can override anything in the app directory unless you changed the namespace).

Oh, and these commands may be useful for you (obviously turn these into an actual alias or function that's aliased):

alias reset
    rm -rf composer.lock node_modules package-lock.json vendor
    composer install
    npm install
    gulp
    composer validate

alias update
    rm -rf node_modules vendor
    composer install
    npm install
    composer update
    npm update
    reset

I would only run these as the branch master though, team members shouldn't have to do dependency updates for Composer and npm.

Kyle Anderson
  • 3,059
  • 1
  • 13
  • 19