관리-도구
편집 파일: contact.blade.php
@extends('layouts.apps') @section('content') <!--start main wrapper--> <main class="main-wrapper"> <div class="main-content"> <!--breadcrumb--> <div class="page-breadcrumb d-none d-sm-flex align-items-center mb-3"> <div class="breadcrumb-title pe-3">Sewdle Boutique</div> <div class="ps-3"> <nav aria-label="breadcrumb"> <ol class="breadcrumb mb-0 p-0"> <li class="breadcrumb-item"><a href="javascript:;"><i class="bx bx-home-alt"></i></a></li> <li class="breadcrumb-item active" aria-current="page">Contacts</li> </ol> </nav> </div> </div> <!--end breadcrumb--> {{-- Success Message --}} @if(session('success')) <div class="alert alert-success alert-dismissible fade show" role="alert"> <strong>Success!</strong> {{ session('success') }} <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button> </div> @endif {{-- Info Message --}} @if(session('message')) <div class="alert alert-info alert-dismissible fade show" role="alert"> {{ session('message') }} <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button> </div> @endif {{-- Error Message --}} @if(session('error')) <div class="alert alert-danger alert-dismissible fade show" role="alert"> <strong>Error:</strong> {{ session('error') }} <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button> </div> @endif {{-- Validation Errors --}} @if($errors->any()) <div class="alert alert-danger alert-dismissible fade show" role="alert"> <ul class="mb-0"> @foreach($errors->all() as $error) <li>{{ $error }}</li> @endforeach </ul> <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button> </div> @endif <div class="row g-3"> <div class="col-auto"> <form method="GET" action="{{ route('admin-contact.index') }}"> <div class="position-relative"> <input class="form-control px-5" type="search" name="search" placeholder="Search Contacts" value="{{ request('search') }}"> <span class="material-icons-outlined position-absolute ms-3 translate-middle-y start-0 top-50 fs-5"> search </span> </div> </form> </div> <div class="col-auto flex-grow-1 overflow-auto"> <div class="btn-group position-static"></div> </div> </div><!--end row--> <div class="card mt-4"> <div class="card-body"> <div class="customer-table"> <div class="table-responsive white-space-nowrap"> <table class="table align-middle"> <thead class="table-light"> <tr> <th><input class="form-check-input" type="checkbox"></th> <th>#</th> <th>Name</th> <th>Email</th> <th>Phone</th> <th>Subject</th> <th>Message</th> <th>Action</th> </tr> </thead> <tbody> @forelse($contacts as $contact) <tr> <td><input class="form-check-input" type="checkbox"></td> <td>{{ $loop->iteration }}</td> <td>{{ $contact->name }}</td> <td>{{ $contact->email }}</td> <td>{{ $contact->phone ?? '-' }}</td> <td>{{ $contact->subject ?? '-' }}</td> <td>{{ $contact->message }}</td> <td> <div class="d-flex gap-3"> <form method="POST" action="{{ route('admin-contact.destroy', $contact->id) }}" style="display:inline;"> @csrf @method('DELETE') <button type="submit" class="btn p-0 border-0 bg-transparent" onclick="return confirm('Are you sure you want to delete this contact?');"> <i class="material-icons-outlined text-danger">delete</i> </button> </form> </div> </td> </tr> @empty <tr> <td colspan="8" class="text-center text-muted py-3">No contacts found.</td> </tr> @endforelse </tbody> </table> </div> </div> </div> </div> </div> </main> <!--end main wrapper--> <!--start overlay--> <div class="overlay btn-toggle"></div> <!--end overlay--> @endsection