form.blade.php
1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
@csrf
@isset($category)
@method('PUT')
@endisset
<label class="form__label" for="name">Заголовок категории
<span class="auth-mail-error auth-mail-error--hidden">Ошибка</span>
</label><br>
@error('name')
<div class="alert alert-danger">{{ $message }}</div>
@enderror
<input class="form-input " type="text" id="name" name="name" placeholder="Введите заголовок" required value="{{ old('name') ?? $category->name ?? '' }}"><br><br>
<label class="form__label" for="content">Описание категории
<span class="auth-mail-error auth-mail-error--hidden">Ошибка</span>
</label><br>
@error('content')
<div class="alert alert-danger">{{ $message }}</div>
@enderror
<textarea class="form-input " id="content" name="content" placeholder="Введите текст"
required>{{ old('text') ?? $category->content ?? '' }}</textarea><br><br>
<label class="form__label" for="image">Картинка
<span class="auth-mail-error auth-mail-error--hidden">Ошибка</span>
</label><br>
<input type="file" class="form-input form-control-file " name="image" id="image" accept="image/png, image/jpeg">
@isset($category->image)
<div class="form-group form-check">
<img src="<?=asset(Storage::url($category->image))?>" width="100px"/>
</div>
@endisset
<label class="form__label" for="image">Категория-родитель
<span class="auth-mail-error auth-mail-error--hidden">Ошибка</span>
</label><br>
<div class="form-group">
@php
$parent_id = old('parent_id') ?? $category->parent_id ?? 0;
@endphp
<select name="parent_id" class="form-control" title="Родитель">
<option value="0">Без родителя</option>
@include('admin.part.parents', ['level' => -1, 'parent' => 0])
</select>
</div>
<<div class="parts-content-form-bottom modal-auth-bottom">
<button class="parts-content-form-bottom__button" type="submit">Сохранить</button>
</div>