Commit 9779d2e57803414392c0b3c52470688940b3fe59

Authored by Hayk Nazaryan
1 parent 5558bda14b
Exists in master

allow set counters description empty

Showing 2 changed files with 4 additions and 2 deletions Side-by-side Diff

app/Http/Controllers/Admin/CompanyController.php
... ... @@ -57,9 +57,11 @@ class CompanyController extends Controller
57 57 }
58 58  
59 59 public function counters_main_update(Request $request, string $name) {
  60 + $data = $request->all();
  61 + $data['description'] = $data['description'] ?? '';
60 62 PageContent::updateOrCreate(
61 63 ['name' => $name],
62   - array_merge(['name' => $name], $request->all())
  64 + array_merge(['name' => $name], $data)
63 65 );
64 66 $block_names = MainPageCounters::values();;
65 67 $blocks = PageContent::select('name', 'title', 'description', 'extra')
resources/views/admin/counters_main/form.blade.php
... ... @@ -27,7 +27,7 @@
27 27  
28 28 <label class="block text-sm">
29 29 <span class="text-gray-700 dark:text-gray-400">Описание</span>
30   - <textarea name="description" id="description" required
  30 + <textarea name="description" id="description"
31 31 class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
32 32 placeholder="Описание" value="{{$blocks[$block_name]['description'] ?? ''}}"
33 33 >{{$blocks[$block_name]['description'] ?? ''}}</textarea>