0
こんにちは皆、あなたを助けてくれることを願っています。マルチ認証Laravel 5.4 - "ルート[admin-login]が定義されていません"
私はlaravel 5.4の新しいバージョンでサインインとサインアップのためのユーザーフォームと管理ユーザー用の別のフォームを持つマルチ認証アプリケーションを作成しようとしています。
ページの私の管理記号のための最初のコントローラを作成した後、タイトルのエラーは、ルートに行くことによって来る:http://localhost:8000/admin_login
このコンソールから作成された私のルートです:PHPの職人ルート:リスト
Route::get('/', function() {
return view('welcome');
});
Auth::routes();
Route::get('admin_login', 'AdminAuth\[email protected]');
Route::post('admin_login', 'AdminAuth\[email protected]');
Route::post('admin_logout', 'AdminAuth\[email protected]');
Route::post('admin_password/email', 'AdminAuth\[email protected]');
Route::get('admin_password/reset', 'AdminAuth\[email protected]');
Route::post('admin_password/reset', 'AdminAuth\[email protected]');
Route::get('admin_password/reset/{token}', 'AdminAuth\[email protected]');
Route::get('admin_register', 'AdminAuth\[email protected]');
Route::post('admin_register', 'AdminAuth\[email protected]');
Route::get('/home', '[email protected]');
Route::get('/admin_home', '[email protected]');
これはAdminAuthから私のLoginControllerです:
<?php
namespace App\Http\Controllers\AdminAuth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
class LoginController extends Controller
{
/*
|--------------------------------------------------------------------------
| Login Controller
|--------------------------------------------------------------------------
|
| This controller handles authenticating users for the application and
| redirecting them to your home screen. The controller uses a trait
| to conveniently provide its functionality to your applications.
|
*/
use AuthenticatesUsers;
/**
* Where to redirect users after login.
*
* @var string
*/
protected $redirectTo = '/home';
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest', ['except' => 'logout']);
}
public function showLoginForm()
{
return view('admin-auth.login');
}
}
そして、この管理者からの私のログイン図である:あなたの助けのための
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="panel panel-default">
<div class="panel-heading">Login Admin</div>
<div class="panel-body">
<form class="form-horizontal" role="form" method="POST" action="{{ route('admin_login') }}">
{{ csrf_field() }}
<div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
<label for="email" class="col-md-4 control-label">E-Mail Address</label>
<div class="col-md-6">
<input id="email" type="email" class="form-control" name="email" value="{{ old('email') }}" required autofocus>
@if ($errors->has('email'))
<span class="help-block">
<strong>{{ $errors->first('email') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
<label for="password" class="col-md-4 control-label">Password</label>
<div class="col-md-6">
<input id="password" type="password" class="form-control" name="password" required>
@if ($errors->has('password'))
<span class="help-block">
<strong>{{ $errors->first('password') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group">
<div class="col-md-6 col-md-offset-4">
<div class="checkbox">
<label>
<input type="checkbox" name="remember" {{ old('remember') ? 'checked' : '' }}> Remember Me
</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-md-8 col-md-offset-4">
<button type="submit" class="btn btn-primary">
Login
</button>
<a class="btn btn-link" href="{{ route('admin_password.request') }}">
Forgot Your Password?
</a>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
@endsection
ありがとう!