Allow editing of tag's color
MODIFY
app/Http/Controllers/TagController.php
app/Http/Controllers/TagController.php
@@ -10,6 +10,7 @@ use App\Tag;
class TagController extends Controller {
private $validationRules = [
'name' => 'required|max:255'
+ // TODO ADD COLOR
];
public function index() {
@@ -46,7 +47,8 @@ class TagController extends Controller {
$request->validate($this->validationRules);
$tag->fill([
- 'name' => $request->input('name')
+ 'name' => $request->input('name'),
+ 'color' => $request->input('color')
])->save();
return redirect()->route('tags.index');

MODIFY
resources/lang/en/fields.php
resources/lang/en/fields.php
@@ -15,5 +15,7 @@ return [
'description' => 'Description',
'amount' => 'Amount',
- 'file' => 'File'
+ 'file' => 'File',
+
+ 'color' => 'Color'
];

MODIFY
resources/views/tags/edit.blade.php
resources/views/tags/edit.blade.php
{{ method_field('PATCH') }}
{{ csrf_field() }}
<div class="box__section">
- <div class="input input--small mb-0">
+ <div class="input input--small">
<label>{{ __('fields.name') }}</label>
<input type="text" name="name" value="{{ $tag->name }}" />
@include('partials.validation_error', ['payload' => 'name'])
</div>
+ <div class="input input--small mb-0">
+ <label>{{ __('fields.color') }}</label>
+ <input type="text" name="color" value="{{ $tag->color }}" />
+ @include('partials.validation_error', ['payload' => 'color'])
+ </div>
</div>
<div class="box__section box__section--highlight row row--right">
<div class="row__column row__column--compact row__column--middle">

Allow editing of tag's color