0

this is the admin routes

Route::get('admin/home', 'AdminController@index');
Route::get('admin', 'Admin\LoginController@showLoginForm')->name('login.admin');
Route::post('admin', 'Admin\LoginController@login');

LoginController

public function __construct()
{
    $this->middleware('guest:admin')->except('logout');
}

public function showLoginForm() {
    return view('admin.login');
}

/**
 * Get the guard to be used during authentication.
 *
 * @return \Illuminate\Contracts\Auth\StatefulGuard
 */
protected function guard()
{
    return Auth::guard('admin');
}

layouts blade

<a class="dropdown-item" href="{{ route('login.admin') }}">
                                    admin login
                                </a>

if someone need to see more code to understand the error please comment

  • 5
    Please post the exact line that the error refers to. – Jeto Jan 13 '21 at 11:30
  • The code you've shown could not have caused this warning. The error specifies both file and line where this is happening. It will most likely be an unquoted string. – El_Vanja Jan 13 '21 at 11:41
  • ErrorException Use of undefined constant admin - assumed 'admin' (this will throw an Error in a future version of PHP) http://localhost:8000/admin thats all i got i have no error line – salim bahouth Jan 13 '21 at 16:27
  • the problem solved it was unquoted string – salim bahouth Jan 13 '21 at 17:15

0 Answers0