我有一个包含截止日期的表单,用户应在四个输入字段中设置截止日期,如下所示:
<div class="form-group col-lg-3">
{!! Form::label('year', 'Year', ['class' => 'control-label']) !!}
{!! Form::selectYear('year',$year, $year +1, null , ['class' => 'form-control']) !!}
</div>
<div class="form-group col-lg-3">
{!! Form::label('month', 'Month', ['class' => 'control-label']) !!}
{!! Form::selectRange('month', 1, 12 , null , ['class' => 'form-control']) !!}
</div>
<div class=" form-group col-lg-3">
{!! Form::label('day', 'Day', ['class' => 'control-label']) !!}
{!! Form::selectRange('day', 1, 31 , null , ['class' => 'form-control']) !!}
</div>
<div class=" form-group col-lg-3">
{!! Form::label('hour', 'Hour', ['class' => 'control-label']) !!}
{!! Form::selectRange('hour', …Run Code Online (Sandbox Code Playgroud) 我需要在所有观点中分享一个集合.此集合包含网站新闻:
$news=NewsStory::orderBy('created_at', 'desc')->paginate(5);
Run Code Online (Sandbox Code Playgroud)
我怎样才能做到这一点?
我需要用户在注册后验证他们的电子邮件地址.我在users表中有确认码和确认字段.如何在用户注册后发送电子邮件?
php user-registration email-verification laravel laravel-5.1
我需要为我的laravel应用程序更改密码功能.我创建了这个视图:
{!! Form::password('old_password', ['class'=>'form-control']) !!}
{!! Form::password('password', ['class'=>'form-control']) !!}
{!! Form::password('password_confirmation', ['class'=>'form-control']) !!}
Run Code Online (Sandbox Code Playgroud)
然后在我的控制器中,我正在检查输入的值old_password是否与用户的当前密码相同.
if(bcrypt($request->old_password) !=$user->password) return redirect()->back()
Run Code Online (Sandbox Code Playgroud)
问题是上述情况总是如此.即使用户输入有效密码,这个条件也会返回真实状态!为什么会这样?顺便说一句,我在我的用户模型中哈希密码:
public function setPasswordAttribute($password){
$this->attributes['password'] = bcrypt($password);
}
Run Code Online (Sandbox Code Playgroud) 我有一个表单,用户可以将文件上传到上传文件夹.在控制器中,我需要检查文件是否已存在于上传目录中,以及是否存在不允许上传同一文件两次.我怎么检查这个?
php ×5
laravel-5.1 ×4
laravel ×3
bcrypt ×1
datetime ×1
file-upload ×1
laravel-5 ×1
validation ×1
view ×1