artisticre
1 month ago
405
2
Laravel

Target class [Admin\LoginController] does not exist

Posted 1 month ago by artisticre

Can't find my error. Help!

routes

<?php

use Illuminate\Support\Facades\Route;

Route::group(['prefix'  =>  'admin'], function () {

Route::get('login', 'Admin\[email protected]')->name('admin.login');
Route::post('login', 'Admin\[email protected]')->name('admin.login.post');
Route::get('logout', 'Admin\[email protected]')->name('admin.logout');

Route::get('/', function () {
    return view('admin.dashboard.index');
});

});

LoginController

<?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');
    }
}

Please sign in or create an account to participate in this conversation.