FIX: fix published_from and published_to fields
This commit is contained in:
@@ -12,14 +12,14 @@ class CreateNewContentRequest extends Request
|
|||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'titlePhoto' => 'image',
|
'titlePhoto' => 'image',
|
||||||
'title' => 'required',
|
'title' => 'required',
|
||||||
'url' => 'required|unique:contents,url',
|
'url' => 'required|unique:contents,url',
|
||||||
'status' => 'required|in:draft,protected,public',
|
'status' => 'required|in:draft,protected,public',
|
||||||
'title_photo' => 'exists:files,id',
|
'title_photo' => 'exists:files,id',
|
||||||
'parentPage' => 'exists:contents,id',
|
'parentPage' => 'exists:contents,id',
|
||||||
'published_from' => 'date',
|
'publishedFrom' => 'date',
|
||||||
'published_to' => 'date',
|
'publishedTo' => 'date',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,13 +18,13 @@ class EditContentRequest extends Request
|
|||||||
$statuses = implode(',', $statuses);
|
$statuses = implode(',', $statuses);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'title' => 'required',
|
'title' => 'required',
|
||||||
'url' => 'required|unique:contents,url,' . $this->id,
|
'url' => 'required|unique:contents,url,' . $this->id,
|
||||||
'published_from' => 'date',
|
'publishedFrom' => 'date',
|
||||||
'published_to' => 'date',
|
'publishedTo' => 'date',
|
||||||
'title_photo' => 'exists:files,id',
|
'title_photo' => 'exists:files,id',
|
||||||
'status' => 'required|in:' . $statuses,
|
'status' => 'required|in:' . $statuses,
|
||||||
'parentPage' => 'exists:contents,id'
|
'parentPage' => 'exists:contents,id'
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
@lang('admin/contents.field_published_from')
|
@lang('admin/contents.field_published_from')
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<input type="datetime" class="form-control" name="published_from" value="{{old('published_from', $page->published_from)}}"
|
<input type="datetime" class="form-control" name="publishedFrom" value="{{old('published_from', $page->published_from)}}"
|
||||||
placeholder="@lang('admin/contents.field_published_from')" />
|
placeholder="@lang('admin/contents.field_published_from')" />
|
||||||
|
|
||||||
@include('admin.snippets.hasError', ['field' => 'published_from'])
|
@include('admin.snippets.hasError', ['field' => 'published_from'])
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
@lang('admin/contents.field_published_to')
|
@lang('admin/contents.field_published_to')
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<input type="datetime" class="form-control" name="published_to" value="{{old('published_to', $page->published_to)}}"
|
<input type="datetime" class="form-control" name="publishedTo" value="{{old('published_to', $page->published_to)}}"
|
||||||
placeholder="@lang('admin/contents.field_published_to')" />
|
placeholder="@lang('admin/contents.field_published_to')" />
|
||||||
@include('admin.snippets.hasError', ['field' => 'published_to'])
|
@include('admin.snippets.hasError', ['field' => 'published_to'])
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user