@section('name', 'Edit Category')
@extends('layout.admin')
@section('content')
<div class="card">

    <div class="card-body">
        <div class="card-name"></div>
        <form action="{{ route('categories.update', ['category' => $category->id]) }}" method="post" enctype="multipart/form-data">
            @csrf
            @method('patch')
            <fieldset>
                <legend>Edit Category</legend>
                @if($errors->any())
                <div class="alert alert-danger">
                {!! implode('', $errors->all('<div>:message</div>')) !!}
                </div>
                @endif
                <div class="row mb-3">
                    <div class="col-sm-12 mb-3">
                        <label class="form-label">Name</label>
                        <input type="text" name="name" value="{{ $category->name }}" require class="form-control">
                    </div>
                    <div class="col-sm-12 mb-3">
                        <label class="form-label">Thumbnail</label>
                        <input type="file" name="image" value="" require class="form-control" accept="image/*">
                    </div>
                </div>
            </fieldset>
            <button type="submit" class="btn btn-primary">Save</button>
        </form>
    </div>
</div>
@endsection
