验证主页不会显示

时间:2016-05-22 16:00:30

标签: laravel laravel-5.2

我正在尝试创建一种简单的身份验证形式,但是当我使用localhost:8000将其加载到浏览器时,它将无法加载主页? 。首先,我创建了一个数据库(auth),之后我在我的cmd中编写了php artisan make:auth,然后创建了我的表php artisan migrate。当我尝试加载localhost:8000时,它只向我显示Laravel 5,但它不会显示身份验证主页。有帮助吗?顺便说一句,我正在使用Laravel 5.2

route.php

<?php
   Route::get('/', function () {
   return view('welcome');
   });

   Route::auth();

   Route::get('/home', 'HomeController@index');
?>

HomeController.php

<?php

namespace App\Http\Controllers;

use App\Http\Requests;
use Illuminate\Http\Request;

class HomeController extends Controller
{
/**
 * Create a new controller instance.
 *
 * @return void
 */
public function __construct()
{
    $this->middleware('auth');
}

/**
 * Show the application dashboard.
 *
 * @return \Illuminate\Http\Response
 */
public function index()
{
    return view('home');
}
}

我在互联网上按照一些步骤如何创建身份验证主页。所以这是我的愿望输出。

Screenshot

1 个答案:

答案 0 :(得分:0)

Route::auth();注册以下路线:

    // Authentication Routes...
    get('login', 'Auth\AuthController@showLoginForm');
    post('login', 'Auth\AuthController@login');
    get('logout', 'Auth\AuthController@logout');

    // Registration Routes...
    get('register', 'Auth\AuthController@showRegistrationForm');
    post('register', 'Auth\AuthController@register');

    // Password Reset Routes...
    get('password/reset/{token?}', 'Auth\PasswordController@showResetForm');
    post('password/email', 'Auth\PasswordController@sendResetLinkEmail');
    post('password/reset', 'Auth\PasswordController@reset');

您应该能够毫无问题地访问它们。

相关问题