Arbeiten mit Laravel 5.1Laravel 5.1 Routen Fehlermeldung
Immer, wenn ich zu mywebsite.com/home
gehe ich zu auth/login
Pfad weitergeleitet, aber es lädt diese Fehlermeldung. Ich bin nicht sicher, was dieses Problem verursacht, alles ist noch ziemlich out of the box. Ich bin nicht sicher, was im Blick auf
MethodNotAllowedHttpException in RouteCollection.php line 219:
Hier ist meine routes.php
Datei
<?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();
}]);
Hier ist meine HomeController.php
Datei
<?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');
}
}
Meine HomeController.php
Indexfunktion ziemlich striaght nach vorn ist. Vielen Dank für all die Hilfe