관리-도구
편집 파일: ContactController.php
<?php namespace App\Http\Controllers; use App\Models\Contact; use Illuminate\Http\Request; class ContactController extends Controller { public function index(){ $contacts = Contact::orderBy('created_at', 'desc')->get(); return view('admin.contact', compact('contacts')); } public function destroy($id){ $contact = Contact::findOrFail($id); $contact -> delete(); return redirect()->route('admin-contact.index')->with('Contact deleted successfully'); } }