Skip to content

Commit

Permalink
checkboxes
Browse files Browse the repository at this point in the history
  • Loading branch information
sdebacker committed Mar 12, 2015
1 parent c97e956 commit fc2f672
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
19 changes: 0 additions & 19 deletions src/Http/Requests/FormRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,4 @@ public function rules()
}
return $rules;
}

/**
* Sanitize inputs
*
* @return array
*/
public function sanitize()
{
$input = $this->all();

// Checkboxes
$input['homepage'] = $this->has('homepage');
foreach (config('translatable.locales') as $locale) {
$input[$locale]['status'] = $this->has($locale . '.status');
}

$this->replace($input);
return $this->all();
}
}
2 changes: 2 additions & 0 deletions src/resources/views/admin/_form.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

<div class="tab-content">

<input type="hidden" name="homepage" value="0">
{!! BootForm::checkbox(trans('validation.attributes.homepage'), 'homepage') !!}

<div class="row">
Expand All @@ -30,6 +31,7 @@

<div class="tab-pane fade @if($locale == $lang)in active @endif" id="content-{{ $lang }}">
@include('core::form._title-and-slug')
<input type="hidden" name="{{ $lang }}[status]" value="0">
{!! BootForm::checkbox(trans('validation.attributes.online'), $lang.'[status]') !!}
{!! BootForm::text(trans('validation.attributes.website'), $lang.'[website]') !!}
{!! BootForm::textarea(trans('validation.attributes.summary'), $lang.'[summary]')->rows(4) !!}
Expand Down

0 comments on commit fc2f672

Please sign in to comment.