Php 为什么我不能在Laravel 5.2中注册和登录?

Php 为什么我不能在Laravel 5.2中注册和登录?,php,html,laravel,laravel-5.2,Php,Html,Laravel,Laravel 5.2,我在Laravel 5.2登录和注册时遇到了一个问题。我在这里使用了Laravel 5.2默认值login.blade.php和register.blade.php。一切都很顺利,但当我试图注册任何用户并填写表单并提交时,它不会在数据库中插入任何数据,也不会在浏览器窗口中显示相同的页面。浏览器做到了未显示任何错误,尽管我已将debug设置为true 这是我的路由。php: <?php use App\Member; use Illuminate\Http\Request; /* |--

我在Laravel 5.2登录和注册时遇到了一个问题。我在这里使用了Laravel 5.2默认值
login.blade.php
register.blade.php
。一切都很顺利,但当我试图注册任何用户并填写表单并提交时,它不会在数据库中插入任何数据,也不会在浏览器窗口中显示相同的页面。浏览器做到了未显示任何错误,尽管我已将debug
设置为true

这是我的路由。php:

<?php

use App\Member;
use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in 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');
});



Route::get('/home', function () {
   return view('home');
});

Route::get('/members', 'MemberController@index');
Route::post('/member', 'MemberController@store');
Route::delete('/member/{member}', 'MemberController@destroy');

// Authentication Routes...
Route::get('auth/login', 'Auth\AuthController@getLogin');
Route::post('auth/login', 'Auth\AuthController@postLogin');
Route::get('auth/logout', 'Auth\AuthController@logout');
// Registration Routes...
Route::get('auth/register', 'Auth\AuthController@getRegister');
Route::post('auth/register', 'Auth\AuthController@postRegister');



/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/

Route::group(['middleware' => ['web']], function () {

    //
});

Route::group(['middleware' => 'web'], function () {
    Route::auth();

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

您已经阅读了答案,只是没有正确地应用它。身份验证需要会话。任何需要会话信息的路由都应该位于
web
中间件组内


现在,您的
成员
成员
身份验证/登录
身份验证/注销
身份验证/注册
,“主页”和
//code>路由都在
网络
中间件组之外,因此它们都没有可用的会话信息(这意味着它们都不会显示用户已登录).

您的受保护路由不应该在应用了中间件的路由组中列出吗?除非你是在控制器中完成的?@haakym我是在控制器中完成的。你能告诉我问题出在哪里吗?我在为我的另一个登录和注册路由执行相同的路由,并且它对我有效。但在这里,当我尝试注册时,它会显示相同的注册页面,并且不会在数据库中插入数据,不会出现任何错误。