I tried to install /laravolt/avatar pluging in my laravel 6 app and got error while installing:
$ composer require laravolt/avatar
Using version ^3.0 for laravolt/avatar
In ProviderRepository.php line 149:
...
Call to undefined method Laravolt\Avatar\Facade::isDeferred()
Script #php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
At https://github.com/laravolt/avatar site I see last updates 5 days ago and I suppose it is not absolute ?
File composer.json of my project :
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.2",
"fideloper/proxy": "^4.0",
"laravel/framework": "^6.2",
"laravel/helpers": "^1.1",
"laravel/passport": "^8.1",
"laravel/tinker": "^2.0",
"laravolt/avatar": "^3.0"
},
"require-dev": {
"facade/ignition": "^1.4",
"fzaninotto/faker": "^1.4",
"laravel/ui": "^1.1",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^3.0",
"phpunit/phpunit": "^8.0"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\\": "app/"
},
"classmap": [
"database/seeds",
"database/factories"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"#php artisan package:discover --ansi"
],
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"#php artisan key:generate --ansi"
]
}
}
Why I have error and how to fix it ?
I searched in net and did not find how to fix it ?
Thanks!
Related
I am on Windows. I have a Laravel Web app with composer.json as follows:
'''
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.2.5",
"bugsnag/bugsnag-laravel": "^2.18",
"doctrine/dbal": "^2.10",
"fideloper/proxy": "^4.2",
"fruitcake/laravel-cors": "^1.0",
"guzzlehttp/guzzle": "^6.3",
"laravel/dusk": "^5.9",
"laravel/framework": "^7.0",
"laravel/tinker": "^2.0",
"laravel/ui": "^2.0",
"yajra/laravel-datatables-oracle": "^9.9",
"laraveldaily/laravel-charts": "^0.1.14",
"spatie/laravel-medialibrary": "^7.19",
"laravel/passport": "^8.4",
"nuovo/spreadsheet-reader": "^0.5.11"
},
"require-dev": {
"facade/ignition": "^2.0",
"fzaninotto/faker": "^1.9.1",
"mockery/mockery": "^1.3.1",
"nunomaduro/collision": "^4.1",
"phpunit/phpunit": "^8.5"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\\": "app/"
},
"classmap": [
"database/seeds",
"database/factories"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"#php artisan package:discover --ansi"
],
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"#php artisan key:generate --ansi"
]
}
}
'''
Whenever I try composer Install or Composer Update it shows
Loading composer repositories with package information
Updating dependencies (including require-dev)
I searched online and then tried both these commands with -vvv to get all the installation messages.
Many packages were downloaded and read and written and after some time it got stuck on
Resolving dependencies through SAT(pass #x)
It goes to 2000 or so pass and still not resolving.
I tried it after composer clear-cache but still the problem persists.
I waited it to resolve overnight but no resolution.
I am new to Web Development so please Help
When I run composer update I get an error message:
"Your requirements could not be resolved to an installable set of packages".
I uploaded some screenshots of the issue below:
This is what my composer.json file looks like.
Composer.json:
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.2.5",
"fideloper/proxy": "^4.2",
"fruitcake/laravel-cors": "^1.0",
"guzzlehttp/guzzle": "^6.3",
"laravel/framework": "5.2.*",
"laravel/tinker": "^2.0",
"laravel/ui": "^2.0",
"intervention/image": "2.*",
"laravelcollective/html": "^6.1"
},
"require-dev": {
"facade/ignition": "^2.0",
"fzaninotto/faker": "^1.9.1",
"mockery/mockery": "^1.3.1",
"nunomaduro/collision": "^4.1",
"phpunit/phpunit": "^8.5"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\\": "app/"
},
"classmap": [
"database/seeds",
"database/factories"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"#php artisan package:discover --ansi"
],
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"#php artisan key:generate --ansi"
]
}
}
As the error message already tells you: you try to mix different versions of Laravel. laravelcollective/html with the version requirement ^6.1 requires Laravel v6 or v7, and some lines above you require Laravel 5.2. Either upgrade laravel/framework to a later version, or downgrade laravelcollective/html to a version that is compatible
I have a project built in laravel 5.8 and I seems to heave update my laravel installation on my pc to 6.0 when I run composer update, it throws an error
my composer.json is below
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.2",
"barryvdh/laravel-ide-helper": "^2.6",
"fideloper/proxy": "^4.0",
"kalnoy/nestedset": "^5.0",
"laravel/framework": "5.8.*",
"laravel/tinker": "^1.0",
"realrashid/sweet-alert": "^2.0",
"unicodeveloper/laravel-paystack": "^1.0",
"watson/active": "^4.0",
"webpatser/laravel-uuid": "^3.0"
},
"require-dev": {
"facade/ignition": "^1.4",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^3.0",
"phpunit/phpunit": "^8.0"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\\": "app/"
},
"classmap": [
"database/seeds",
"database/factories"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"#php artisan package:discover --ansi"
],
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"#php artisan key:generate --ansi"
]
}
}
You are getting this error because some of the dependencies in your composer.json requires lower version or higher version of laravel/framework v5.8.35 .
Here is a tip, go through your composer.json file if there are dependencies not being used by your application, delete them from your composer.json file.
Then run
composer update
If it still not solve your problem , try installing the lower version of laravel/framework
for example ,
composer require laravel/framework:1.*
or try installing latest version of laravel/framework
composer install laravel/framework:5.3.*
I want to run composer update on my laravel project but I keep getting this error:
[Seld\JsonLint\ParsingException]
"./composer.json" does not contain valid JSON
Parse error on line 1:
^
Expected one of: 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '['
I have validated my composer.json on www.jsonlint.com and the json is valid. I don't know what could be the cause.
My composer.json
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=7.0.0",
"anhskohbo/no-captcha": "^2.4",
"fideloper/proxy": "~3.3",
"intervention/image": "^2.4",
"laravel/framework": "5.5.*",
"laravel/socialite": "^3.0",
"laravel/tinker": "~1.0",
"laravelcollective/html": "^5.4.0",
"stripe/stripe-php": "^5.2"
},
"require-dev": {
"filp/whoops": "~2.0",
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~6.0"
},
"autoload": {
"classmap": [
"database/seeds",
"database/factories"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"extra": {
"laravel": {
"dont-discover": [
]
}
},
"scripts": {
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"#php artisan key:generate"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"#php artisan package:discover"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
}
}
Change your composer.json file according to this:
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": ">=7.0.0",
"fideloper/proxy": "~3.3",
"laravel/framework": "5.5.*",
"laravel/tinker": "~1.0"
},
"require-dev": {
"filp/whoops": "~2.0",
"fzaninotto/faker": "~1.4",
"mockery/mockery": "~1.0",
"phpunit/phpunit": "~7.0"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\\": "app/"
},
"classmap": [
"database/seeds",
"database/factories"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"#php artisan key:generate"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"#php artisan package:discover"
]
}
}
After Changes of composer.json file, must be run this command: composer update
To install the most recent version, run the following command:
For intervention/image package: composer require intervention/image
For laravel/socialite package: composer require laravel/socialite
For No CAPTCHA reCAPTCHA package: composer require anhskohbo/no-captcha
For laravelcollective/html package: composer require laravelcollective/html
For stripe/stripe-php package: composer require stripe/stripe-php
NOTE: This will download latest version of your laravel project
I moved my laravel application to 5.7 :
$ php artisan --version
Laravel Framework 5.7.3
but trying to use new pagination method linksOnEachSide what I found in docs:
$homepage_quizzes_per_page= 2;
$activeQuizVotes= Vote::getByStatus('A')->
getByIsHomepage(true)->
getByIsQuiz(true)->
orderBy('ordering','desc')->
orderBy('created_at','desc')->
leftJoin(\DB::raw('vote_categories as vc '), \DB::raw('vc.id'), '=', \DB::raw('votes.vote_category_id'))->
select(\DB::raw(" votes.*, vc.name as vote_category_name, vc.slug as vote_category_slug"))->
paginate($homepage_quizzes_per_page)->
linksOnEachSide( (int)($homepage_quizzes_per_page/2) );
I got error :
Method Illuminate\Database\Eloquent\Collection::linksOnEachSide does not exist.
If in code above to comment last line with linksOnEachSide - it works ok and I have valid pagination.
My composer.json has :
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": "^7.1.3",
"cviebrock/eloquent-sluggable": "^4.5",
"davejamesmiller/laravel-breadcrumbs": "5.x",
"doctrine/dbal": "^2.8",
"fideloper/proxy": "^4.0",
"intervention/image": "^2.4",
"itsgoingd/clockwork": "^3.0",
"laravel/framework": "5.7.*",
"laravel/tinker": "^1.0",
"laravelcollective/html": "^5.4.0",
"proengsoft/laravel-jsvalidation": ">2.2.0",
"rap2hpoutre/laravel-log-viewer": "^0.19.1",
"snowfire/beautymail": "dev-master",
"themsaid/laravel-mail-preview": "^2.0",
"wboyz/laravel-enum": "^0.2.1",
"yajra/laravel-datatables-oracle": "^8.7"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.1",
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^2.0",
"phpunit/phpunit": "^7.0"
},
"autoload": {
"classmap": [
"database/seeds",
"database/factories"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"extra": {
"laravel": {
"dont-discover": [
]
}
},
"scripts": {
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"#php artisan key:generate"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"#php artisan package:discover"
],
"post-update-cmd": [
"php artisan vendor:publish --provider=\"Proengsoft\\JsValidation\\JsValidationServiceProvider\" --tag=public --force"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
},
"minimum-stability": "dev",
"prefer-stable": true
}
Why error and how to fix it ? Some invalid options ? Or I have to update some more libs apart "laravel/framework": "5.7.*" ?
Thanks!
The method has been renamed to onEachSide().