I cant understand why I am getting the above error when I navigate to the admin login page of my Laravel project. The Laravel version is 7x. How can i fix this?
<?php
namespace App\Http\Controllers\Admin;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
class LoginController extends Controller
{
use AuthenticatesUsers;
/**
* Where to redirect admins after login.
*
* @var string
*/
protected $redirectTo = '/admin';
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest:admin')->except('logout');
}
/**
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function showLoginForm()
{
return view('admin.auth.login');
}
}
Ok if anyone has this error this is because of the following:
All authentication scaffolding has been moved to the
laravel/ui
repository. If you are using Laravel's authentication scaffolding, you should install the^2.0
release of this package and the package should be installed in all environments.
So to resolve the error simply run the composer command on the root folder of the laravel application:
composer require laravel/ui "^2.0"
Or simply run:
composer require laravel/ui
Hope this helps.
In a terminal window, execute this command:
composer require laravel/ui "^2.0"
Then execute one of these commands (with your JS favorite framework):
Once the laravel/ui package has been installed, you may install the frontend scaffolding using the ui Artisan commands:
php artisan ui vue --auth
Restart your local development environment and your code editor.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With