File: /home/workzeni/stream-flix.workzenix.com/resources/views/admin/pages/categories/edit.blade.php
@extends('admin.index')
@section('title', 'Edit Category')
@section('content')
<div class="content-area">
<!-- Header Section -->
<div class="text-center mb-5">
<h1 class="mb-2" style="font-weight: 700;">Edit Category</h1>
<p class="text-muted" style="max-width: 600px; margin: 0 auto;">
Update the category details below to keep your content organized effectively.
</p>
</div>
<!-- Form Card Centered -->
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card shadow-sm border-0">
<div class="card-body p-4">
<form id="editCategoryForm" action="{{ route('category.update', $category->id) }}" method="POST">
@csrf
@method('PUT')
<!-- Category Name -->
<div class="form-group mb-3">
<label class="form-label fw-semibold">Category Name *</label>
<input type="text"
name="name"
class="form-control"
placeholder="Enter category name"
value="{{ old('name', $category->name) }}"
required>
</div>
<!-- Status -->
<div class="form-group mb-3">
<label class="form-label fw-semibold">Status</label>
<select name="status" class="form-control">
<option value="active" {{ $category->status == 'active' ? 'selected' : '' }}>Active</option>
<option value="inactive" {{ $category->status == 'inactive' ? 'selected' : '' }}>Inactive</option>
</select>
</div>
<!-- Featured Checkbox -->
<div class="form-group mb-4">
<div class="form-check">
<!-- Hidden input ensures 0 if unchecked -->
<input type="hidden" name="featured" value="0">
<input type="checkbox"
name="featured"
value="1"
id="featured"
class="form-check-input"
{{ $category->featured ? 'checked' : '' }}>
<label class="form-check-label" for="featured">
Feature this category
</label>
</div>
</div>
<!-- Buttons -->
<div class="d-flex justify-content-between align-items-center">
<button type="submit" class="btn btn-primary">
<i class="fas fa-save me-1"></i> Update Category
</button>
<a href="{{ route('category.list') }}" class="btn btn-outline-secondary">
<i class="fas fa-arrow-left me-1"></i> Back to List
</a>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
@endsection