Call to undefined method Laravel\Socialite\Facades\Socialite::isDeferred() - php

Hi i'm new to laravel socialite,when i run the command php artisan config:cache to update the .env file i get this error: Call to undefined method Laravel\Socialite\Facades\Socialite::isDeferred();
composer require laravel/socialite
Using version ^5.1 for laravel/socialite
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 6 installs, 0 updates, 0 removals
Installing ralouphie/getallheaders (3.0.3): Loading from cache
Installing guzzlehttp/psr7 (1.7.0): Loading from cache
Installing guzzlehttp/promises (1.4.0): Loading from cache
Installing guzzlehttp/guzzle (7.2.0): Loading from cache
Installing league/oauth1-client (v1.8.2): Loading from cache
Installing laravel/socialite (v5.1.0): Loading from cache
'C:\xampp\htdocs\matatu6.0\vendor/laravel/socialite/59c666443f49cf231e2c48e7a17aefd5' is not a zip archive.
Unzip with ZipArchive class failed, falling back to unzip command
Failed to download laravel/socialite from dist: Failed to execute (9) unzip -qq -o "C:\xampp\htdocs\matatu6.0\vendor/laravel/socialite/59c666443f49cf231e2c48e7a17aefd5" -d "C:\x
ampp\htdocs\matatu6.0/vendor/composer/5556bc2b"
[C:\xampp\htdocs\matatu6.0\vendor/laravel/socialite/59c666443f49cf231e2c48e7a17aefd5]
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of C:\xampp\htdocs\matatu6.0\vendor/laravel/socialite/59c666443f49cf231e2c48e7a17aefd5 or
C:\xampp\htdocs\matatu6.0\vendor/laravel/socialite/59c666443f49cf231e2c48e7a17aefd5.zip, and cannot find C:\xampp\htdocs\matatu6.0\vendor/laravel/socialite/59c666443f49cf231
e2c48e7a17aefd5.ZIP, period.
Now trying to download from source
Installing laravel/socialite (v5.1.0): Cloning 14082c6651 from cache
guzzlehttp/psr7 suggests installing laminas/laminas-httphandlerrunner (Emit PSR-7 responses)
guzzlehttp/guzzle suggests installing ext-intl (Required for Internationalized Domain Name (IDN) support)
Package jakub-onderka/php-console-color is abandoned, you should avoid using it. Use php-parallel-lint/php-console-color instead.
Package jakub-onderka/php-console-highlighter is abandoned, you should avoid using it. Use php-parallel-lint/php-console-highlighter instead.
Writing lock file
Generating optimized autoload files
Illuminate\Foundation\ComposerScripts::postAutoloadDump
#php artisan package:discover --ansi
In ProviderRepository.php line 149:
Call to undefined method Laravel\Socialite\Facades\Socialite::isDeferred()
Script #php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
Installation failed, reverting ./composer.json to its original content.

update: upgrading from the laravel 5 way of declaring provide class in config/app, this ended up conflicting with laravel 6 package auto discovery, therefore causing even php artisan config:clear and composer dump-autoload not to work. removing 'Socialite' => Laravel\Socialite\Facades\Socialite::class in config/app.php solved this issue and re-installing the socialite package

Related

The command "composer require barryvdh/laravel-dompdf" always gets an error

I am trying to run this command: composer require barryvdh/laravel-dompdf
And I get this in my cmd:
Using version ^1.0 for barryvdh/laravel-dompdf
./composer.json has been updated
Running composer update barryvdh/laravel-dompdf
Loading composer repositories with package information
Updating dependencies
Lock file operations: 5 installs, 0 updates, 0 removals
- Locking barryvdh/laravel-dompdf (v1.0.0)
- Locking dompdf/dompdf (v1.2.2)
- Locking phenx/php-font-lib (0.5.4)
- Locking phenx/php-svg-lib (0.4.1)
- Locking sabberworm/php-css-parser (8.4.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 5 installs, 0 updates, 0 removals
- Installing sabberworm/php-css-parser (8.4.0): Extracting archive
- Installing phenx/php-svg-lib (0.4.1): Extracting archive
- Installing phenx/php-font-lib (0.5.4): Extracting archive
- Installing dompdf/dompdf (v1.2.2): Extracting archive
- Installing barryvdh/laravel-dompdf (v1.0.0): Extracting archive
3 package suggestions were added by new dependencies, use `composer suggest` to see details.
Generating optimized autoload files
Illuminate\Foundation\ComposerScripts::postAutoloadDump
#php artisan package:discover --ansi
In PackageManifest.php line 178:
The C:\xampp\htdocs\Proyectos\Monitor\bootstrap\cache directory must be present and writable.
Script #php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
And even on top of that, my project stopped working and shows:
This error that I've never seen before
I tried everything that I found on internet, clear cache, update composer and still I get the same kind of error, I am using Laravel 9 version. I'm desperate please help
Step 1 : Delete the cache folder and recreate again in bootstrap directory.
step 2 : run the command php artisan cache:clear

Laravel composer TypeError during installation

I have a little problem with my composer.
I'm using laragon on windows so everything is 'made' for me.
I've installed using composer require pragmarx/tracker command, and it was fine.
But because I'm a bit stupid I thought it was causing some problems so I've removed it with composer remove pragmarx/tracker. Now I want to reinstall it, but I got the following problem.
I can't find a solution anywhere, and I don't really understand the problem.
C:\laragon\www\Portfolio (master)
λ composer require pragmarx/tracker
Using version ^4.0 for pragmarx/tracker
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 12 installs, 0 updates, 0 removals
- Installing jaybizzle/crawler-detect (v1.2.96): Loading from cache
- Installing snowplow/referer-parser (0.2.0): Loading from cache
- Installing pragmarx/datatables (v1.4.12): Loading from cache
- Installing composer/ca-bundle (1.2.7): Loading from cache
- Installing ua-parser/uap-php (v3.9.13): Loading from cache
- Installing mobiledetect/mobiledetectlib (2.8.34): Loading from cache
- Installing jenssegers/agent (v2.6.4): Loading from cache
- Installing pragmarx/support (0.9.2): Loading from cache
- Installing doctrine/event-manager (1.1.1): Loading from cache
- Installing doctrine/cache (1.10.2): Loading from cache
- Installing doctrine/dbal (2.10.2): Loading from cache
- Installing pragmarx/tracker (v4.0.0): Loading from cache
snowplow/referer-parser suggests installing symfony/yaml (Support for YAML configuration file)
ua-parser/uap-php suggests installing symfony/yaml (Required for CLI usage - ^3.4 || ^4.3 || ^5.0)
ua-parser/uap-php suggests installing symfony/filesystem (Required for CLI usage - ^3.4 || ^4.3 || ^5.0)
pragmarx/support suggests installing symfony/yaml (The Yaml class needs it)
doctrine/cache suggests installing alcaeus/mongo-php-adapter (Required to use legacy MongoDB driver)
pragmarx/tracker suggests installing geoip/geoip (~1.14)
pragmarx/tracker suggests installing geoip2/geoip2 (~2.0)
Writing lock file
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> #php artisan package:discover --ansi
TypeError
Argument 1 passed to UAParser\Parser::parse() must be of the type string, null given, called in C:\laragon\www\Portfolio\vendor\pragmarx\tracker\src\Support\UserAgentParser.php on line 25
at C:\laragon\www\Portfolio\vendor\ua-parser\uap-php\src\Parser.php:37
33| $this->userAgentParser = new UserAgentParser($this->regexes);
34| }
35|
36| /** Sets up some standard variables as well as starts the user agent parsing process */
> 37| public function parse(string $userAgent, array $jsParseBits = []): Client
38| {
39| $client = new Client($userAgent);
40|
41| $client->ua = $this->userAgentParser->parseUserAgent($userAgent, $jsParseBits);
1 C:\laragon\www\Portfolio\vendor\pragmarx\tracker\src\Support\UserAgentParser.php:25
UAParser\Parser::parse()
2 C:\laragon\www\Portfolio\vendor\pragmarx\tracker\src\Vendor\Laravel\ServiceProvider.php:174
PragmaRX\Tracker\Support\UserAgentParser::__construct("C:\laragon\www\Portfolio")
Script #php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
Installation failed, reverting ./composer.json to its original content.
EDIT 1:
The result of composer dump-autoload is:
composer dump-autoload
Generating optimized autoload files> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> #php artisan package:discover --ansi
TypeError
Argument 1 passed to UAParser\Parser::parse() must be of the type string, null given, called in C:\laragon\www\Portfolio\vendor\pragmarx\tracker\src\Support\UserAgentParser.php on line 25
at C:\laragon\www\Portfolio\vendor\ua-parser\uap-php\src\Parser.php:37
33| $this->userAgentParser = new UserAgentParser($this->regexes);
34| }
35|
36| /** Sets up some standard variables as well as starts the user agent parsing process */
> 37| public function parse(string $userAgent, array $jsParseBits = []): Client
38| {
39| $client = new Client($userAgent);
40|
41| $client->ua = $this->userAgentParser->parseUserAgent($userAgent, $jsParseBits);
1 C:\laragon\www\Portfolio\vendor\pragmarx\tracker\src\Support\UserAgentParser.php:25
UAParser\Parser::parse()
2 C:\laragon\www\Portfolio\vendor\pragmarx\tracker\src\Vendor\Laravel\ServiceProvider.php:174
PragmaRX\Tracker\Support\UserAgentParser::__construct("C:\laragon\www\Portfolio")
Script #php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

Error when installing package with composer but package seems installed anyway

I'm trying to install the package maddhatter/laravel-fullcalendar (Laravel helper for FullCalendar.io) with composer.
So here is the command I run:
'''
php ../../composer.phar require maddhatter/laravel-fullcalendar
'''
And here is the result:
Using version ^1.3 for maddhatter/laravel-fullcalendar
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
- Installing maddhatter/laravel-fullcalendar (v1.3.0): Downloading (100%)
Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.
Writing lock file
Generating autoload files
php artisan clear-compiled
[Symfony\Component\Debug\Exception\FatalErrorException]
Call to undefined method Illuminate\Foundation\Application::getCachedCompilePath()
Script php artisan clear-compiled handling the post-update-cmd event returned with error code 255
But now I wonder if the package is installed or not, because it now appears in my list of installed packages.
If anyone has the answer, thanks in advance.
Try to delete file compiled.php in your vendor directory manually, and then it started to work again.

Required dependencies not updating

I'm updating some packages with composer. I'm using Laravel5.6 in my project.
The one that I'm trying is PHPStan to version 0.10.7. My current version is 0.9.2.
The problem
When I try to update, it shows a success message, but when checking the outdate packages output, it is still OUTDATED.
What I've tried
Using composer why-not phpstan/phpstan 0.10.7 gave me the following output:
laravel/laravel my-branch-test requires (for development) phpstan/phpstan (^0.9.2)
phpstan/phpstan 0.10.7 requires nikic/php-parser (^4.0.2)
laravel/laravel my-branch-test does not require nikic/php-parser (but v3.1.5 is installed)
phpstan/phpstan 0.10.7 requires phpstan/phpdoc-parser (^0.3)
laravel/laravel my-branch-test does not require phpstan/phpdoc-parser (but 0.2 is installed)
Then I tried to update nikic/php-parser and phpdoc-parser and re-run composer update phpstan/phpstan but it gave me the same result of before. (not updating)
UPDATE: running composer update phpstan/phpstan --with-dependencies gave me the following output:(but still didn't updated phpstan)
composer update phpstan/phpstan --with-dependencies
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 11 updates, 0 removals
- Updating ocramius/package-versions (1.2.0 => 1.3.0): Loading from cache
- Updating symfony/finder (v4.1.4 => v4.2.1): Loading from cache
- Updating symfony/polyfill-mbstring (v1.9.0 => v1.10.0): Loading from cache
- Updating jean85/pretty-package-versions (1.1 => 1.2): Loading from cache
- Updating nette/utils (v2.4.9 => v2.5.3): Loading from cache
- Updating nette/php-generator (v3.0.2 => v3.0.5): Loading from cache
- Updating nette/neon (v2.4.2 => v2.4.3): Loading from cache
- Updating nette/di (v2.4.10 => v2.4.14): Loading from cache
- Updating nette/bootstrap (v2.4.5 => v2.4.6): Loading from cache
- Updating nette/finder (v2.4.1 => v2.4.2): Loading from cache
- Updating nette/robot-loader (v3.0.3 => v3.1.0): Loading from cache
Package sebastian/git is abandoned, you should avoid using it. No replacement was suggested.
Writing lock file
Generating autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> #php artisan package:discover
Discovered Package: barryvdh/laravel-debugbar
Discovered Package: caffeinated/modules
Discovered Package: fideloper/proxy
Discovered Package: jenssegers/agent
Discovered Package: laravel/tinker
Discovered Package: rap2hpoutre/laravel-log-viewer
Discovered Package: rcrowe/twigbridge
Package manifest generated successfully.
ocramius/package-versions: Generating version class...
ocramius/package-versions: ...done generating version class
Code
In my composer.json file, the package is listed as:
"require-dev": {
"phpstan/phpstan": "^0.9.2",
Any ideas?
The problem here was that others packages that I was using were using the nikic/php-parser package too, but considering only non-breaking changes (nikic/php-parser":"^3.0"), "blocking" the upgrade to > 4.0.
Because of composer can't install two versions of the same package, my solution was not updating phpstan for now.
I will wait for the libs that require nikic/php-parser to update their requirements to 4.0 and up or will change these packages in the future.

How to install intervention image with Windows

In Intervention Image's website, it says that in order to install the most recent version, I must run the following command :
php composer.phar require intervention/image
I am using Windows 8.1 and I guess this isn't going to work. I already tried and it says : Could not open input file: composer.phar
Am I missing something very easy?
Use this command
composer require intervention/image
As Sinan Bolel mentionned, in windows, instead of "php composer.phar" you type "composer" and the following...
First of all you point you project directory after that you should run "composer require intervention/image""command.
Your result like this
Admin#Admin-dell MINGW64 /c/xampp/htdocs/laravel_dev
$ composer require intervention/image
Using version ^2.3 for intervention/image
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing psr/http-message (1.0)
Loading from cache
- Installing guzzlehttp/psr7 (1.3.0)
Loading from cache
- Installing intervention/image (2.3.7)
Downloading: 100%
intervention/image suggests installing ext-imagick (to use Imagick based image processing.)
intervention/image suggests installing intervention/imagecache (Caching extension for the Intervention Image library)
Writing lock file
Generating autoload files
> Illuminate\Foundation\ComposerScripts::postUpdate
> php artisan optimize
Generating optimized class loader
Admin#Admin-dell MINGW64 /c/xampp/htdocs/laravel_dev
In order to use composer, you first need to install it.
https://getcomposer.org/doc/00-intro.md#installation-windows
composer require intervention/image
and in config/app.php
return [
...
$provides => [
...
Intervention\Image\ImageServiceProvider::class
],
$aliases => [
...
'Image' => Intervention\Image\Facades\Image::class
]
]

Categories