Laravel 5.7 Class App\Http\Controllers\Auth\VerificationController does not exist - laravel-5

When I add ['verify' => true] parameter to web auth routes like so
Auth::routes(['verify' => true]);
I cannot see routes when calling
$ php artisan route:list
instead of a table I'm getting:
ReflectionException : Class App\Http\Controllers\Auth\VerificationController does not exist
And it is truth, I don't have a file called VerificationController nowhere on my computer.
I'm currently on laravel/framework version 5.7.20

the Upgrade Guide when Upgrading To 5.7.0 From 5.6
suggests to make a controller manually in the
Email Verification section.
this is a VerificationController.php that officially should be used in this case

Related

Laravel nova keeps throwing exception Route [nova.login] not defined

I've already posted this to https://github.com/laravel/nova-issues sadly hadn't got any love from there, so I'd like to know if anyone experienced this issue and how they resolved it.
Laravel Version: 5.7.27
Nova Version: 1.2
PHP Version: 7.2.12
Operating System and Version: MacOS 10.13.6
Browser type and version: Chrome (Latest) FireFox (Latest)
Description:
Whenever I access my nova route in /admin <-- (this is where my nova resides) I get this exception thrown from/vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php line 389, throw new InvalidArgumentException("Route [{$name}] not defined."), my nova was installled correctly and currently I don't have any other existing app routes this is a fresh install of laravel and fresh install of nova.
It was working fine until I introduced the custom path.
Steps To Reproduce:
Change the 'path' => '/admin'
Run php artisan config:clear or php artisan config:cache
Check your NovaServiceProvider.php and make sure it has withAuthenticationRoutes() in the routes() function like this:
protected function routes()
{
Nova::routes()
->withAuthenticationRoutes()
->withPasswordResetRoutes()
->register();
}

How to fix "Non-static method Spatie\Analytics\Analytics::fetchVisitorsAndPageViews() should not be called statically?"

When i put:
use Spatie\Analytics\Analytics;
It gives the error
'Non-static method should not be called statically'
But when I only put:
use Analytics;
I gives a white page on refresh or says
"The use statement with non-compound name 'Analytics' has no effect "
when starting.
I am using Laravel 5.5.4 and although it says the facade should be automatically setup, it wasn't working so I also added this manually to the // config/app.php:
'Analytics' => Spatie\Analytics\AnalyticsFacade::class,
But it still is not working.
from the package github. there was a solution
php artisan config:clear
but it did not work for me.
This package can be installed through Composer.
composer require spatie/laravel-analytics
In Laravel 5.5 and above the package will autoregister the service provider. In Laravel 5.4 you must install this service provider.
config/app.php
'providers' => [
...
Spatie\Analytics\AnalyticsServiceProvider::class,
...
];
In Laravel 5.5 and above the package will autoregister the facade. In Laravel 5.4 you must install the facade manually.
config/app.php
'aliases' => [
...
'Analytics' => Spatie\Analytics\AnalyticsFacade::class,
...
];
You want to use the facade to access the class, you will need to change:
use Spatie\Analytics\Analytics; to use Analytics;
Another way around just import this to your class:
use Spatie\Analytics\AnalyticsFacade as Analytics
It depends in what context you place the use statement.
In Laravel you also can use facades without having to import it with use.
The same class can be called by using \Analytics in your code call.
Example:
\Analytics::fetchMostVisitedPages(\Period::days(7));

Lumen with Dingo API routes not defined

Have a fresh install of Lumen 5.2 and new install of Dingo 1.0.*#dev
I have installed the service provided in bootstrap/app.php
Also setup .env file eg
API_VERSION=v1
API_PREFIX=api
API_SUBTYPE=app
API_DEBUG=true
In the Http/routes.php I have added a test route eg
$api = app('Dingo\Api\Routing\Router');
$api->version('v1', ['namespace' => 'App\Http\Controllers\V1'], function ($api) {
$api->get('example', 'ExampleController#test');
});
This route is not working plus in command line if I try php artisan api:routes
I get error
[Symfony\Component\Console\Exception\CommandNotFoundException]
Command "api:routes" is not defined.
Did you mean this?
api:docs
Have I missed something? Also using HTTP Basic if it helps?
In Dingo Documentation -> Creating API Endpoints section you can find this sentence:
"If you're using Laravel 5.1 you can see the registered routes using Artisan.
$ php artisan api:routes
"
If you also run
$ php artisan list
only api:docs is available - api:routes is missing.
That means that this command do not work in Lumen.
composer requires jakubkratina/lumen-dingo-route-list
Add the following code in app/Console/Kernel.php:
protected $commands = [
\JK\Dingo\Api\Console\Commands\RouteListCommand::class
];
By default, as shown in docs, lumen don't ship with api:routes. But you can use lumen-dingo-route-list from jakubkratina. It will add route:list to your artisan.
By the way, I'd to do some adjustments to get it working:
First, include the backlash into the registration
protected $commands = [
\JK\Dingo\Api\Console\Commands\RouteListCommand::class
];
And last, edit vendor/jakubkratina/lumen-dingo-route-list/src/RouteListCommand.php and add this code:
public function handle()
{
return $this->fire();
}

Target [Laravel\Socialite\Contracts\Factory] is not instantiable

I am using laravel lumen 5.2.
Target [Laravel\Socialite\Contracts\Factory] is not instantiable.
I came across this error when trying to get Laravel to login with Twitter using the Socialite package.
Work already done:
A) In config\app.php
1. Laravel\Socialite\SocialiteServiceProvider::class
2. 'Socialite' => Laravel\Socialite\Facades\Socialite::class
I followed this :
http://goodheads.io/2015/08/24/using-twitter-authentication-for-login-in-laravel-5/
You would need to add the following in config/app.php
In providers add this
Laravel\Socialite\SocialiteServiceProvider::class
In aliases add this
'Socialite' => Laravel\Socialite\Facades\Socialite::class
What helped me is writing
use Socialite;
in the controller (just the alias, not the full path). And then running
php artisan config:clear
in the terminal.
For me, it was to add $app->register( \Laravel\Socialite\SocialiteServiceProvider::class); to app.php in the bootstrap folder, using Lumen 5.6.

Can not start laravel after trying to install library

I have web-app on Laravel and I tried to update yajra/datatables to last version, so it needed
'Maatwebsite\Excel\ExcelServiceProvider'
I tried composer update, so it didn't help.
Now I removed this line from composer.json
But on calling php artisan clear-compiled
It shows me an error:
PHP Fatal error: Class 'Maatwebsite\Excel\ExcelServiceProvider' not found in /var/www/html/talimger.xyz/vendor/laravel/framework/src/Illuminate/Foundation/Application.php on line 575
Show where I should remove this Maatwebsite files
`
The instructions at https://github.com/Maatwebsite/Laravel-Excel tell you what to do, but not how to do it. The assumption is that you already know a bit about composer.
Here's the 'how to do it'...
1) Remove the service provider entries you made and delete any lines you added to composer and then type the following:
composer require "maatwebsite/excel"
2) After updating composer, add the ServiceProvider to the providers array in config/app.php
Laravel 5.1:
'Maatwebsite\Excel\ExcelServiceProvider',
Laravel 5.2:
Maatwebsite\Excel\ExcelServiceProvider::class,
3) You can use the facade for shorter code. Add this to your aliases:
Laravel 5.1:
'Excel' => 'Maatwebsite\Excel\Facades\Excel',
Laravel 5.2:
'Excel' => Maatwebsite\Excel\Facades\Excel,::class
Comment out 'Maatwebsite\Excel\ExcelServiceProvider' from the providers array in app.php under config then run composer update when you are done then your uncomment it.

Resources