Last active
September 10, 2015 09:31
-
-
Save nicolasbinet/c18cccaea887d2cea01a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Requests; | |
use App\Http\Requests\Request; | |
class DashboardSerieRequest extends Request | |
{ | |
/** | |
* Determine if the user is authorized to make this request. | |
* | |
* @return bool | |
*/ | |
public function authorize() | |
{ | |
return true; | |
} | |
/** | |
* Get the validation rules that apply to the request. | |
* | |
* @return array | |
*/ | |
public function rules() | |
{ | |
return [ | |
'name' => 'required|max:128', | |
'seo.titlte' => 'required|string', | |
'seo.description' => 'string', | |
'seo.keywords' => 'string', | |
'seo.noindex' => 'boolean', | |
]; | |
} | |
/** | |
* Set custom messages for validator errors. | |
* | |
* @return array | |
*/ | |
public function messages() | |
{ | |
return [ | |
]; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="panel panel-default"> | |
<div class="panel-heading">Datas</div> | |
<div class="panel-body"> | |
<div class="form-group @if ($errors->has('name')) has-error has-feedback @endif"> | |
{!! Form::label('name', 'Nom', ['class' => 'control-label']) !!} | |
{!! Form::text('name', null, ['class' => 'form-control']) !!} | |
@if ($errors->has('name')) | |
<p class="help-block">{{ $errors->first('name') }}</p> | |
@endif | |
</div> | |
<div class="form-group @if ($errors->has('seo.title')) has-error has-feedback @endif"> | |
{!! Form::label('seo[title]', 'Titre', ['class' => 'control-label']) !!} | |
{!! Form::text('seo[title]', null, ['class' => 'form-control']) !!} | |
@if ($errors->has('seo.title')) | |
<p class="help-block">{{ $errors->first('seo.title') }}</p> | |
@endif | |
</div> | |
<div class="form-group @if ($errors->has('seo.keywords')) has-error has-feedback @endif"> | |
{!! Form::label('seo[keywords]', 'Mots-clés', ['class' => 'control-label']) !!} | |
{!! Form::text('seo[keywords]', null, ['class' => 'form-control']) !!} | |
@if ($errors->has('seo.keywords')) | |
<p class="help-block">{{ $errors->first('seo.keywords') }}</p> | |
@endif | |
</div> | |
<div class="form-group @if ($errors->has('seo.description')) has-error has-feedback @endif"> | |
{!! Form::label('seo[description]', 'Description', ['class' => 'control-label']) !!} | |
{!! Form::textarea('seo[description]', null, ['class' => 'form-control', 'rows' => 3]) !!} | |
@if ($errors->has('seo.description')) | |
<p class="help-block">{{ $errors->first('seo.description') }}</p> | |
@endif | |
</div> | |
<div class="form-group @if ($errors->has('seo.noindex')) has-error has-feedback @endif"> | |
{!! Form::label('seo[noindex]', 'Indexable par les moteurs de recherche', ['class' => 'control-label']) !!} | |
{!! Form::select('seo[noindex]', [1 => 'Autorisée', 0 => 'Pas d\'indexation'], null, ['class' => 'form-control']) !!} | |
@if ($errors->has('seo.noindex')) | |
<p class="help-block">{{ $errors->first('seo.noindex') }}</p> | |
@endif | |
</div> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment