From 68ac541d4a8bb7a68c4e36a86c97b32c9a7dd7cb Mon Sep 17 00:00:00 2001 From: Samuel De Backer Date: Thu, 12 Mar 2015 23:35:06 +0100 Subject: [PATCH] checkboxes --- src/Http/Requests/FormRequest.php | 18 ------------------ src/Models/Place.php | 2 ++ src/resources/views/admin/_form.blade.php | 1 + 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/src/Http/Requests/FormRequest.php b/src/Http/Requests/FormRequest.php index 841f2af..9a99a6e 100644 --- a/src/Http/Requests/FormRequest.php +++ b/src/Http/Requests/FormRequest.php @@ -23,22 +23,4 @@ public function rules() } return $rules; } - - /** - * Sanitize inputs - * - * @return array - */ - public function sanitize() - { - $input = $this->all(); - - // Checkboxes - foreach (config('translatable.locales') as $locale) { - $input[$locale]['status'] = $this->has($locale . '.status'); - } - - $this->replace($input); - return $this->all(); - } } diff --git a/src/Models/Place.php b/src/Models/Place.php index 897c4a1..b7ce773 100644 --- a/src/Models/Place.php +++ b/src/Models/Place.php @@ -45,6 +45,8 @@ class Place extends Base 'status', ); + protected $appends = ['status', 'title', 'thumb']; + /** * Columns that are file. * diff --git a/src/resources/views/admin/_form.blade.php b/src/resources/views/admin/_form.blade.php index 471ace4..2cf64f0 100644 --- a/src/resources/views/admin/_form.blade.php +++ b/src/resources/views/admin/_form.blade.php @@ -38,6 +38,7 @@
@include('core::form._title-and-slug') + {!! BootForm::checkbox(trans('validation.attributes.online'), $lang.'[status]') !!} {!! BootForm::textarea(trans('validation.attributes.summary'), $lang.'[summary]')->rows(4) !!} {!! BootForm::textarea(trans('validation.attributes.body'), $lang.'[body]')->addClass('ckeditor') !!}