This commit is contained in:
denisdulici 2018-04-10 13:21:51 +03:00
parent 696a635c26
commit 094e9d3002
2 changed files with 9 additions and 2 deletions

View File

@ -63,7 +63,9 @@ class Categories extends Controller
*/
public function edit(Category $category)
{
return view('settings.categories.edit', compact('category'));
$transfer_id = Category::transfer();
return view('settings.categories.edit', compact('category', 'transfer_id'));
}
/**

View File

@ -14,7 +14,12 @@
<div class="box-body">
{{ Form::textGroup('name', trans('general.name'), 'id-card-o') }}
{{ Form::selectGroup('type', trans_choice('general.types', 1), 'bars', ['expense' => 'Expense', 'income' => 'Income', 'item' => 'Item', 'other' => 'Other'], config('general.types')) }}
@if ($category->id == $transfer_id)
{{ Form::selectGroup('type', trans_choice('general.types', 1), 'bars', ['expense' => 'Expense', 'income' => 'Income', 'item' => 'Item', 'other' => 'Other'], null, ['required' => 'required', 'disabled' => 'disabled']) }}
<input type="hidden" name="type" value="other" />
@else
{{ Form::selectGroup('type', trans_choice('general.types', 1), 'bars', ['expense' => 'Expense', 'income' => 'Income', 'item' => 'Item', 'other' => 'Other']) }}
@endif
<div class="form-group col-md-6 required {{ $errors->has('color') ? 'has-error' : ''}}">
{!! Form::label('color', trans('general.color'), ['class' => 'control-label']) !!}