Mo a
Mo a

Reputation: 31

Laravel:eloquent-sluggable

Hello when i want to install cviebrock eloquent-sluggable package i run the following error please guide me thank you

This is my terminal text when it gives me this error:

H:\website\xampp\htdocs\laravel2>composer require cviebrock/eloquent-sluggable
Using version ^7.0 for cviebrock/eloquent-sluggable
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for cviebrock/eloquent-sluggable ^7.0 -> satisfiable by cviebrock/eloquent-sluggable[7.0.0].
    - Conclusion: remove laravel/framework v6.18.3
    - Conclusion: don't install laravel/framework v6.18.3
    - cviebrock/eloquent-sluggable 7.0.0 requires illuminate/config ^7.0 -> satisfiable by laravel/framework[7.x-dev], illuminate/config[7.x-dev, v7.0.0
, v7.0.1, v7.0.2, v7.0.3, v7.0.4, v7.0.5, v7.0.6, v7.0.7, v7.0.8, v7.1.0, v7.1.1, v7.1.2, v7.1.3, v7.2.0, v7.2.1, v7.2.2, v7.3.0].
    - Can only install one of: laravel/framework[7.x-dev, v6.18.3].
    - don't install illuminate/config 7.x-dev|don't install laravel/framework v6.18.3
    - don't install illuminate/config v7.0.0|don't install laravel/framework v6.18.3
    - don't install illuminate/config v7.0.1|don't install laravel/framework v6.18.3
    - don't install illuminate/config v7.0.2|don't install laravel/framework v6.18.3
    - don't install illuminate/config v7.0.3|don't install laravel/framework v6.18.3
    - don't install illuminate/config v7.0.4|don't install laravel/framework v6.18.3
    - don't install illuminate/config v7.0.5|don't install laravel/framework v6.18.3
    - don't install illuminate/config v7.0.6|don't install laravel/framework v6.18.3
    - don't install illuminate/config v7.0.7|don't install laravel/framework v6.18.3
    - don't install illuminate/config v7.0.8|don't install laravel/framework v6.18.3
    - don't install illuminate/config v7.1.0|don't install laravel/framework v6.18.3
    - don't install illuminate/config v7.1.1|don't install laravel/framework v6.18.3
    - don't install illuminate/config v7.1.2|don't install laravel/framework v6.18.3
    - don't install illuminate/config v7.1.3|don't install laravel/framework v6.18.3
    - don't install illuminate/config v7.2.0|don't install laravel/framework v6.18.3
    - don't install illuminate/config v7.2.1|don't install laravel/framework v6.18.3
    - don't install illuminate/config v7.2.2|don't install laravel/framework v6.18.3
    - don't install illuminate/config v7.3.0|don't install laravel/framework v6.18.3
    - Installation request for laravel/framework (locked at v6.18.3, required as ^6.2) -> satisfiable by laravel/framework[v6.18.3].


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

Upvotes: 2

Views: 4642

Answers (6)

Gul Muhammad
Gul Muhammad

Reputation: 176

You can try for Laravel 8

composer require cviebrock/eloquent-sluggable 8.0.*

Upvotes: 0

JSTR
JSTR

Reputation: 151

If anyone encountered same problem. You must use match the Laravel version to eloquent-sluggable package version. Visit here eloquent sluggable

and if still has an error. try this

composer require cviebrock/eloquent-sluggable 6.0.*

use 6.0.* instead of ^6.0

Upvotes: 2

Anil Kumar Thakur
Anil Kumar Thakur

Reputation: 17

for this package

'slug' => [
                'source' => ['title']
            ]

how can we implement an auto-update slug when updating the title field

Upvotes: 0

Oladipupo Fredrick
Oladipupo Fredrick

Reputation: 51

If anyone is having this issue in the future while upgrading from laravel 6 to 7. Update your "cviebrock/eloquent-sluggable" to version 7 like so "cviebrock/eloquent-sluggable": "^7.0" in your composer.json file

Upvotes: 1

Jud3v Digital
Jud3v Digital

Reputation: 311

Laravel have a default class for slug Str::slug($variable_or_plain_text, ‘the symbol you want to replaced by space’);

Upvotes: 0

Julio Motol
Julio Motol

Reputation: 833

This is a dependency version problem. You're trying to install cviebrock/eloquent-sluggable ^7.0 which is requires laravel/framework ^7.0 but you have laravel/framework 6.18.3. More info here.

Try installing a lower version of cviebrock/eloquent-sluggable(preferably ^6.0) by doing composer require cviebrock/eloquent-sluggable ^6.0.

Upvotes: 1

Related Questions