Answer the question
In order to leave comments, you need to log in
Why doesn't Form Model Binding work when inheriting the Blade template?
Laravel 5.4, laravelcollective/html 5.4.8
There is a basic add content page template:
@extends('layouts.master')
@section('content')
<div class="panel-body">
@if(count($errors))
@include('common.errors')
@endif
{!! Form::model($entry, ['method' => $method, 'class' => 'form-horizontal', 'route' => [$route]]) !!}
@section('fields')
@foreach (['title', 'url', 'content', 'meta_tags', 'meta_description', 'is_active'] as $field)
@include('entries.fields.' . $field)
@endforeach
@show
<div class="form-group">
<div class="col-sm-offset-3 col-sm-6">
@section('submit')
{!! Form::submit('Добавить', ['class' => 'btn btn-default']) !!}
@show
</div>
</div>
{!! Form::close() !!}
</div>
@endsection
@extends('entries.create')
@section('title')
Добавить статью / {{ config('site.site_name') }}
@endsection
@section('fields')
@foreach ([
'entries.fields.title',
'entries.fields.url',
'articles.fields.description',
'entries.fields.content',
'entries.fields.meta_description',
'entries.fields.is_active',
'articles.fields.enable_comments',
'articles.fields.show_on_main',
'articles.fields.rank',
] as $field)
@include($field)
@endforeach
@endsection
{!! Form::label('enable_comments', 'Включить комментарии', ['class' => 'col-sm-3 control-label']) !!}
<div class="col-sm-6">
{!! Form::checkbox('enable_comments', null, null, ['class' => 'checkbox']) !!}
</div>
</div>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question