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 a419aa1 commit 68ac541
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 18 deletions.
18 changes: 0 additions & 18 deletions src/Http/Requests/FormRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
2 changes: 2 additions & 0 deletions src/Models/Place.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ class Place extends Base
'status',
);

protected $appends = ['status', 'title', 'thumb'];

/**
* Columns that are file.
*
Expand Down
1 change: 1 addition & 0 deletions src/resources/views/admin/_form.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,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::textarea(trans('validation.attributes.summary'), $lang.'[summary]')->rows(4) !!}
{!! BootForm::textarea(trans('validation.attributes.body'), $lang.'[body]')->addClass('ckeditor') !!}
Expand Down

0 comments on commit 68ac541

Please sign in to comment.