PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, January 4, 2022

[FIXED] Unable to add spatie/laravel-sluggable package in laravel 5.4

 January 04, 2022     composer-php, laravel, laravel-5, php     No comments   

Issue

I tried to add spatie/laravel-sluggable in my setup but faced this error in the terminal. I tried to search this but didn't find any relevant solution.

Here is the error:

Problem 1
    - Conclusion: remove laravel/framework v5.4.36
    - Conclusion: don't install laravel/framework v5.4.36
    - spatie/laravel-sluggable 2.1.0 requires illuminate/database ~5.5.0 
      -> satisfiable by illuminate/database[v5.5.0, v5.5.16, v5.5.17, v5.5.2, v5.5.28, v5.5.33, v5.5.34, v5.5.35, v5.5.36, v5.5.37, v5.5.39, v5.5.40, v5.5.41, v5.5.43, v5.5.44].
    - spatie/laravel-sluggable 2.1.5 requires illuminate/database ~5.5.0|~5.6.0|~5.7.0 
      -> satisfiable by illuminate/database[5.7.17, 5.7.18, 5.7.19, v5.5.0, v5.5.16, v5.5.17, v5.5.2, v5.5.28, v5.5.33, v5.5.34, v5.5.35, v5.5.36, v5.5.37, v5.5.39, v5.5.40, v5.5.41, v5.5.43, v5.5.44, v5.6.0, v5.6.1, v5.6.10, v5.6.11, v5.6.12, v5.6.13, v5.6.14, v5.6.15, v5.6.16, v5.6.17, v5.6.19, v5.6.2, v5.6.20, v5.6.21, v5.6.22, v5.6.23, v5.6.24, v5.6.25, v5.6.26, v5.6.27, v5.6.28, v5.6.29, v5.6.3, v5.6.30, v5.6.31, v5.6.32, v5.6.33, v5.6.34, v5.6.35, v5.6.36, v5.6.37, v5.6.38, v5.6.39, v5.6.4, v5.6.5, v5.6.6, v5.6.7, v5.6.8, v5.6.9, v5.7.0, v5.7.1, v5.7.10, v5.7.11, v5.7.15, v5.7.2, v5.7.20, v5.7.21, v5.7.22, v5.7.23, v5.7.26, v5.7.27, v5.7.3, v5.7.4, v5.7.5, v5.7.6, v5.7.7, v5.7.8, v5.7.9].
    - spatie/laravel-sluggable 2.1.6 requires illuminate/database ~5.5.0|~5.6.0|~5.7.0 
      -> satisfiable by illuminate/database[5.7.17, 5.7.18, 5.7.19, v5.5.0, v5.5.16, v5.5.17, v5.5.2, v5.5.28, v5.5.33, v5.5.34, v5.5.35, v5.5.36, v5.5.37, v5.5.39, v5.5.40, v5.5.41, v5.5.43, v5.5.44, v5.6.0, v5.6.1, v5.6.10, v5.6.11, v5.6.12,
    - don't install illuminate/database v5.5.0|don't install laravel/framework v5.4.36
    - don't install illuminate/database v5.5.16|don't install laravel/framework v5.4.36
    - don't install illuminate/database v5.5.17|don't install laravel/framework v5.4.36
    - don't install illuminate/database v5.5.2|don't install laravel/framework v5.4.36
    - don't install illuminate/database v5.5.28|don't install laravel/framework v5.4.36
    - don't install illuminate/database v5.5.33|don't install laravel/framework v5.4.36
    - don't install illuminate/database v5.5.34|don't install laravel/framework v5.4.36
    - don't install illuminate/database v5.5.35|don't install laravel/framework v5.4.36
    - don't install illuminate/database v5.5.36|don't install laravel/framework v5.4.36
    - don't install illuminate/database v5.5.37|don't install laravel/framework v5.4.36
    - don't install illuminate/database v5.5.39|don't install laravel/framework v5.4.36
    - don't install illuminate/database v5.5.40|don't install laravel/framework v5.4.36
    - don't install illuminate/database v5.5.41|don't install laravel/framework v5.4.36
    - don't install illuminate/database v5.5.43|don't install laravel/framework v5.4.36
    - don't install illuminate/database v5.5.44|don't install laravel/framework v5.4.36
    - don't install illuminate/database v5.6.0|don't install laravel/framework v5.4.36
    - don't install illuminate/database v5.6.1|don't install laravel/framework v5.4.36
    - Installation request for laravel/framework (locked at v5.4.36, required as 5.4.*) 
      -> satisfiable by laravel/framework[v5.4.36].
    - Installation request for spatie/laravel-sluggable ^2.1 
      -> satisfiable by spatie/laravel-sluggable[2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.1.4, 2.1.5, 2.1.6].


Installation failed, reverting ./composer.json to its original content.

I also tried to add illuminate/database but it also showed the same issue.


Solution

You can always verify the requirements of a package in its composer.json file.

For example, in your case, you can check the composer.json here: https://github.com/spatie/laravel-sluggable/blob/master/composer.json#L18#L23

You can notice this:

"require": {
    "php" : ">=7.0.0",
    "illuminate/database": "~5.5.0|~5.6.0|~5.7.0",
    "illuminate/support": "~5.5.0|~5.6.0|~5.7.0"
},

Here it says the minimum PHP version required and also mentions the illuminate/database and illuminate/support package version requirement, which is 5.5, 5.6 and 5.7 and above.

These illuminate packages are for Laravel. They are the core packages of the Laravel framework so their version should match with your laravel version.

You cannot install the old illuminate package on newer Laravel version.

I would suggest you upgrade your Laravel to 5.5 or to the latest one. Spatie and their packages are most of the times up to date so you better update yours as well.



Answered By - Pankaj
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing