简体   繁体   English

Laravel 5.1身份验证不起作用

[英]Laravel 5.1 authentication not working

I'm new to Laravel 5.1 and getting my head around it I started to build a blog with it. 我是Laravel 5.1的新手,但我开始着手建立它的博客。 But there comes a problem. 但是有一个问题。 My users cannot login after registration. 我的用户注册后无法登录。

One thing is that when they register they are automatically signed in but after that (after they have logged out) they can't login again. 一件事是,当他们注册时,他们会自动登录,但是之后(在他们注销之后),他们将无法再次登录。

The error message appearing is the email field is required. 出现此错误消息是必填字段。 No matter what you put into the email field it still return email field is required. 无论您在电子邮件字段中输入什么内容,仍需要返回电子邮件字段。

This is the login form, I'm using the Illuminate/Html package 这是登录表单,我使用的是Illuminate / Html包

@extends('main')

@section('title')

Login 

@stop

@section('content')

<div class="row">
<h1>Please Login</h1>

<hr>
</div>

{!! Form::open() !!}
<div class="row">
    <div class="large-6 columns">
        {!! Form::label('email', 'Username:') !!}
        {!! Form::text('email', null, [ 'placeholder' => 'Enter your email']) !!}
    </div>
</div>

<div class="row">
    <div class="large-6 columns">
        {!! Form::label('password', 'Password:') !!}
        {!! Form::password('password', null, [ 'placeholder' => 'Enter Password']) !!}
    </div>
</div>

<div class="row">
    <div class="large-6 columns">
        {!! Form::checkbox('remember') !!}
        {!! Form::label('remember', 'Remembe Me') !!}
    </div>
</div>

<div class="row">
    <div class="large-6 columns">
        {!! Form::submit('Login', [ 'class' => 'expand radius button']) !!}
    </div>
</div>

@if($errors->any())
<div class="row">
    <div class="large-6 columns">
        <ul class="errors">

            @foreach($errors->all() as $error)
                <li>{{ $error }}</li>
            @endforeach
        </ul>
    </div>
</div>
@endif
{!! Form::close() !!}

 @stop

Thanks for your time. 谢谢你的时间。

If u are using authentication change 如果您正在使用身份验证更改

Form::open() 

to

 {{Form::open(array('url' => 'auth/login', 'method' => 'post'))}}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM