与laravel 5.1laravel 5.1路线错误信息
工作每当我去mywebsite.com/home
我重定向到auth/login
路径,但它加载此错误消息。林不知道是什么原因造成这个问题,一切都仍然是开箱即用。林不知道什么即时通讯俯瞰
MethodNotAllowedHttpException in RouteCollection.php line 219:
这里是我的routes.php
文件
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::get('/', function() {
return view('welcome');
});
// Authentication routes
Route::get('login', 'Auth\[email protected]');
Route::post('auth/login', 'Auth\[email protected]');
Route::get('auth/logout', 'Auth\[email protected]');
// Registration routes
Route::get('register', 'Auth\[email protected]');
Route::post('auth/register', 'Auth\[email protected]');
Route::controllers(['password' => 'Auth\PasswordController',]);
Route::get('/home', '[email protected]');
// Using A Route Closure
Route::get('profile', ['middleware' => 'auth', function() {
// Only authenticated users may enter...
Route::auth();
}]);
这里是我的HomeController.php
文件
<?php
namespace App\Http\Controllers;
use Auth;
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()
{
if(Auth::check()) {
return view('home');
}
return view('auth/login');
}
}
我HomeController.php
索引功能相当striaght前进。感谢所有帮助