Laravel Socialite class not found [duplicate] - laravel

This question already has an answer here:
Class 'Socialite' not found [duplicate]
(1 answer)
Closed 5 years ago.
I need to set up social authentication in Laravel. I am using Laravel Socialite and it is not working at all. I am following the official github documentation. However, I am facing Class 'Socialite' not found error. I don't really know why. I have even included use Socialite; at the top of before the class starts.
I have added the providers Laravel\Socialite\SocialiteServiceProvider::class, and the facade 'Socialite' => Laravel\Socialite\Facades\Socialite::class,.
I used hacks like composer dump-autoload, php artisan cache:clear and composer update but to no avail.
I am using Socialite Version 3.0.7 and my Laravel version is 5.4.33.
I even tried using use Laravel\Socialite\Facades\Socialite; but then I get Target [Laravel\Socialite\Contracts\Factory] is not instantiable. error.

Please add this 'use Socialite;' in your controller issue will resolve cause after installing packagist 'laravel/socialite' you might be not calling it in your controller.

Related

Laravel Modules , create model,migration and controller in single command(artisan) [duplicate]

This question already has answers here:
Error “Target class controller does not exist” when using Laravel 8
(27 answers)
Closed 9 months ago.
This post was edited and submitted for review 9 months ago and failed to reopen the post:
Original close reason(s) were not resolved
I'm working on a modules Laravel project, and I wonder if it is possible to create model, migration and controller in single command (artisan).
I'm already aware of this command:
php artisan make:model Todo -mcr
This only works in a default Laravel project not a modular one.
I also read all the commands in modular artisan commands docs, but there is no mention of this issue.
Following the official documentation :
use App\Http\Controllers\ArticleController;
Route::resource('articles', ArticleController::class);

Laravel composer issue with consolibyte

I want to use consolibyte in my laravel project.
So I did
composer require consolibyte/quickbooks
and then I did
compose update
But still I am not able to use the classes and constants of consolibyte in my project.
I also tried adding this
"files": ["vendor/consolibyte/quickbooks/QuickBooks.php"]
to the autoload section of the compose.json
and then I again did
composer update
but this I got an error
QUICKBOOKS_TIMESTAMP is already defined
Can I get some insight if I am missing something here?

Upgrading Laravel 6 to 7 I have errors with barryvdh/laravel-cors

Upgrading Laravel 6.14.0 to 7 for my laravel backend app
and reading this doc https://laravel.com/docs/7.x/upgrade#upgrade-7.0
I have errors with support of barryvdh/laravel-cors, as I got erorr in console:
Class 'Barryvdh\Cors\ServiceProvider' not found
If to comment 1 line In config/app.php :
// Barryvdh\Cors\ServiceProvider::class,
and reference in app/Http/Kernel.php
I passed console commands(like config cache).
But I got CORS errors in my vue/cli app.
I tried to search in net for Barryvdh\Cors
and seems here https://packagist.org/packages/barryvdh/laravel-cors there is support for laravel 7,
but if installation was changed?
Also I found this https://github.com/fruitcake/laravel-cors package.
Is it replacement of Barryvdh\Cors? Which steps have I to take to run my app as laravel 7?
Thanks!
Yes, Laravel 7 includes first-party support for configuring Cross-Origin Resource Sharing (CORS). It looks like you will have to add the fruitcake/laravel-cors dependency. here is the CORS Support upgrade information from the Laravel documentation.
Yes the vendor name has changed, you can find the upgrade guide here:
Upgrading from 0.x
When upgrading from 0.x versions, there are some breaking changes:
The vendor name has changed (see installation/usage)
Group middleware is no longer supported.
A new 'paths' property is used to enable/disable CORS on certain routes. This is empty by default!
The casing on the props in cors.php has changed from camelCase to snake_case, so if you already have a cors.php file you will
need to update the props in there to match the new casing.
You can find the installation / usage guide here.
PS:
Laravel 5.5 and onward support package auto-discovery so you don't have to add anything into config/app.php anymore.

Laravel 5.2 view in register a provider

i have installed the chat package:
https://github.com/dazzz1er/confer
Unfortunately i get an error when i try to publish it. Here is the error:
[Symfony\Component\Debug\Exception\FatalErrorException]
Call to undefined method Illuminate\Support\Facades\View::composer()
Thanks !
As correctly pointed out by #curious_coder confer is not compatible with Laravel 5.2 yet. Please keep an on the open Laravel 5.2 issue on Github and/or ask the author of this package for updates.

Upgrading to Laravel 5.2

having some issues trying to upgrade to Laravel 5.2 from the previous latest version.
On composer update or any artisan class I get the follow error ...
Class validator does not exist
Can not work out whats going on at all.
Any ideas?
Many thanks!
Turns out Whoops was catching a HttpResponseException of which the upgrade docs do say could cause issues. So removed Whoops as problem solved.

Resources