form.blade.php 1.44 KB
@csrf

@isset($banner)
    @method('PUT')
@endisset

<label class="form__label" for="title">Заголовок баннера
    <span class="auth-mail-error auth-mail-error--hidden">Ошибка</span>
</label><br>
@error('title')
<div class="alert alert-danger">{{ $message }}</div>
@enderror
<input class="form-input " type="text" id="title" name="title" placeholder="Введите заголовок" required value="{{ old('title') ?? $banner->title ?? '' }}"><br><br>

<label class="form__label" for="text">Описание баннера
    <span class="auth-mail-error auth-mail-error--hidden">Ошибка</span>
</label><br>
@error('text')
<div class="alert alert-danger">{{ $message }}</div>
@enderror
<textarea class="form-input " id="text" name="text" placeholder="Введите текст"
          required>{{ old('text') ?? $banner->text ?? '' }}</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($banner->image)
    <div class="form-group form-check">
        <img src="<?=asset(Storage::url($banner->image))?>" width="100px"/>
    </div>
@endisset

<<div class="parts-content-form-bottom modal-auth-bottom">
    <button class="parts-content-form-bottom__button" type="submit">Сохранить</button>
</div>