Skip to content

Commit 68ac541

Browse files
committed
checkboxes
1 parent a419aa1 commit 68ac541

File tree

3 files changed

+3
-18
lines changed

3 files changed

+3
-18
lines changed

src/Http/Requests/FormRequest.php

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,4 @@ public function rules()
2323
}
2424
return $rules;
2525
}
26-
27-
/**
28-
* Sanitize inputs
29-
*
30-
* @return array
31-
*/
32-
public function sanitize()
33-
{
34-
$input = $this->all();
35-
36-
// Checkboxes
37-
foreach (config('translatable.locales') as $locale) {
38-
$input[$locale]['status'] = $this->has($locale . '.status');
39-
}
40-
41-
$this->replace($input);
42-
return $this->all();
43-
}
4426
}

src/Models/Place.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ class Place extends Base
4545
'status',
4646
);
4747

48+
protected $appends = ['status', 'title', 'thumb'];
49+
4850
/**
4951
* Columns that are file.
5052
*

src/resources/views/admin/_form.blade.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838

3939
<div class="tab-pane fade @if($locale == $lang)in active @endif" id="content-{{ $lang }}">
4040
@include('core::form._title-and-slug')
41+
<input type="hidden" name="{{ $lang }}[status]" value="0">
4142
{!! BootForm::checkbox(trans('validation.attributes.online'), $lang.'[status]') !!}
4243
{!! BootForm::textarea(trans('validation.attributes.summary'), $lang.'[summary]')->rows(4) !!}
4344
{!! BootForm::textarea(trans('validation.attributes.body'), $lang.'[body]')->addClass('ckeditor') !!}

0 commit comments

Comments
 (0)