我在我的登录中使用SSL作为我的网站(Cloudflare HTTPS),因为我使用``,Laravel不会将我的网站链接转换为SSL版本,它会显示http版本.我如何强迫Laravel https为我使用?
例如:
<?=Form::open(array('id' =>'submit'))?>
. . .
<?=Form::close()?>
Run Code Online (Sandbox Code Playgroud)
结果将是:
<form method="POST" action="http://example.com" accept-charset="UTF-8" id="submit">
</form>
Run Code Online (Sandbox Code Playgroud)
我想action成为一个HTTPS链接.
我有一个带有选择输入的表单,验证很好,但是在失败时,选择字段不填充旧值 这里是我的选择字段
<div class="control-group">
<label class="control-label">Gender :</label>
<div class="controls">
<select name="gender" value= "{{ Input::old('gender') }}">
<option>Select</option>
<option value="M">Male</option>
<option value="F">Female</option>
</select>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
我怎么能解决这个问题?
我有一个像文本字段
{!! Form::textarea('representive[address_1]' ,null ,['class' =>'textboxlong form-control','style'=>'height:60px;']) !!}
Run Code Online (Sandbox Code Playgroud)
在我的形式.当我试图在我的控制器中获取它的值但是它为空.我尝试的是
$adress = Request::get('representive.0.address_1');
Run Code Online (Sandbox Code Playgroud)
我也尝试过其他一些方法,但最终无法找到合适的解决方案.我如何获得该字段的值?任何帮助,将不胜感激.
我在同一页面上有三种不同的表格。所有输入都有自己的验证规则,请求文件中的代码具有如下结构:
public function rules()
{
return [
//
'sold' => 'required',
'unit_in_stock' => 'required',
'unit_price_gbp' => 'required',
'returned_item' => 'required',
];
}
public function messages()
{
return [
'sold.required' => 'Please enter quantity of sold parts',
'unit_in_stock.required' => 'Please enter quantity of sold parts',
'unit_price_gbp.required' => 'Please enter price in GBP',
'returned_item.required' => 'Please enter quantity of items',
];
}
Run Code Online (Sandbox Code Playgroud)
但是当我尝试提交三个表单之一时,另一个表单返回有关空字段的消息。这种形式彼此不相关。
这是我的表格:
{!! Form::open(['url' => route('addDelivery.addDelivery'),'class'=>'contact-form','method'=>'POST']) !!}
<label>Price in GBP £:</label>
{!! Form::text('unit_price_gbp', isset($price->unit_price_gbp) ? $price->unit_price_gbp : old('unit_price_gbp'), array('class'=>'form-control'), …Run Code Online (Sandbox Code Playgroud) laravel laravel-5 laravel-validation laravel-form laravel-request
我有兴趣在没有作曲家的Laravel 5上安装Form和HTML类.我怎样才能做到这一点?
对于那些想要说服我使用作曲家的人:
1)我想通过至少一次手动操作来看看它做了什么.
2)我的托管上没有作曲家.
3)使用composer.phar抛出一个错误:Script php artisan clear-compiled handling the pre-update-cmd event returned with an error,发出警告:Warning: Composer should be invoked via the CLI version of PHP, not the cgi-fcgi SAPI和运行时异常,输出空白错误.
laravel composer-php laravel-5 laravel-form laravelcollective
我正在使用引导选择器,我想设置一个下拉菜单。使引导选择器选择所需的正确方法是什么?(我不想使用任何其他 jquery 插件)。
{!! Form::select('from', [], null, ['class' => 'selectpicker form-control', 'data-live-search' => '1', 'data-size' => '6', 'title' => 'Select a partner',]) !!}Run Code Online (Sandbox Code Playgroud)
我正在将 selectpicker 用于 laravel 形式的集合中。
我使用以下命令创建身份验证系统:
php artisan make:auth
Run Code Online (Sandbox Code Playgroud)
效果很好。但是,当我尝试自定义设计和其他内容时,一切对我来说都显得很混乱。即:当我尝试使用错误的凭据时,我无法显示诸如“无效的用户名/密码”之类的消息。我检查了 Auth 文件夹内的所有控制器,但没有详细代码。我的要求非常简单:我只想将错误消息从控制器传递给我的自定义设计的 HTML 模板来查看和显示。这是我的登录表单:
@extends('layouts.login')
@section('content')
<div class="content">
<!-- BEGIN LOGIN FORM -->
<form class="login-form" method="POST" action="{{ route('login') }}">
@csrf
<h3 class="form-title">Login to your account</h3>
CUSTOM_ERROR_MESSAGE_IF_LOGIN_FAILED
<div class="alert alert-danger display-hide">
<button class="close" data-close="alert"></button>
<span>
Enter any username and password. </span>
</div>
<div class="form-group">
<!--ie8, ie9 does not support html5 placeholder, so we just show field title for that-->
<label class="control-label visible-ie8 visible-ie9">Username</label>
<div class="input-icon">
<i class="fa fa-user"></i>
<!-- <input class="form-control placeholder-no-fix" type="text" autocomplete="off" placeholder="Username" name="username"/> …Run Code Online (Sandbox Code Playgroud) 我想json_encode($request->all())在提交表单后运行,但是返回的数组被"污染"了_method和_token值.
有没有任何巧妙的方法从生成的json中排除特定于框架的字段?
我有一个表单,用户可以在其中创建一个项目。然而,当表单被提交并且没有通过验证时,旧的输入不会被记住并且被简单地擦除,这对用户来说是令人沮丧的。
我为此使用了 laravelcollective 表单,我的 html 看起来像:
{{ Form::open(['route' => 'my.route', 'class' => 'form-horizontal', 'files' => true]) }}
<div class="form-group">
{{ Form::label('name', 'Name', ['class' => 'control-label col-md-3']) }}
<div class="col-md-9">
{{ Form::text('name', null, ['placeholder' => 'hello world' ,'class' => 'form-control']) }}
</div>
</div>
<div class="form-group">
{{ Form::label('description', 'Description', ['class' => 'control-label col-md-3']) }}
<div class="col-md-9">
{{ Form::textarea('description', null, ['placeholder' => 'hello world', 'class' => 'form-control']) }}
<span>some sub-text</span>
</div>
</div>
<div class="form-group">
{{ Form::label('date', 'Date', ['class' => 'control-label col-md-3']) }}
<div …Run Code Online (Sandbox Code Playgroud) 我有以下形式作为"删除"按钮.
{{ Form::open(['method' => 'DELETE', 'route' => ['notes.delete', $note->user->id]]) }}
{{ Form::submit('Delete', ['class' => 'btn btn-warning btn-sm']) }}
{{ Form::close() }}
Run Code Online (Sandbox Code Playgroud)
有没有办法用Font Awesome图标替换"删除"按钮文本?我尝试将其更改为:
{{ Form::submit('<i class="fa fa-minus-circle" aria-hidden="true"></i>', ['class' => 'btn btn-warning btn-sm']) }}
Run Code Online (Sandbox Code Playgroud)
但是,它不显示图标,而只显示HTML代码的原始版本 - <i class="fa fa-minus-circle" aria-hidden="true"></i>.有没有办法使用Font Awesome和Laravel表格?
我尝试将一个表单放在foreach循环中.代码是:
@foreach( $document_rows as $row )
<?php
$idx = $row->id;
$product = Product::find( $row->product_id );
$vat = Vat::find( $row->vat_id );
$tot_riga = floatval($row->price) * intval($row->product_quantity);
?>
{!! Form::open([
'method' => 'PUT',
'route' => [ 'document.row.update', $document->id, $row->id ],
'class' => 'form-horizontal',
]) !!}
<tr class="document_row">
<td
id="field_id-{{ $idx }}"
readonly="true"
data-field="id"
data-id="{{ $idx }}"
>
{{ $idx }}
</td>
<td
class="field"
id="field_name-{{$idx}}"
data-field="name"
data-id="{{ $idx }}"
>
{{ $row->product_name }}
</td>
<td
class="field"
id="field_um-{{$idx}}"
data-field="um"
data-id="{{ $idx }}"
>
{{ …Run Code Online (Sandbox Code Playgroud) laravel-form ×11
laravel ×9
laravel-5 ×7
php ×6
forms ×2
cloudflare ×1
composer-php ×1
css ×1
font-awesome ×1
input ×1
laravel-4 ×1
laravel-5.2 ×1
ssl ×1