<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use App\Models\KritikSaran;
use Illuminate\Http\Request;

class KritikSaranController extends Controller
{
    public function index()
    {
        $feedbacks = KritikSaran::orderBy('created_at', 'desc')->get();
        return view('admin.kritiksaran.index', compact('feedbacks'));
    }

    public function destroy($id)
    {
        $feedback = KritikSaran::findOrFail($id);
        $feedback->delete();

        return redirect()->route('admin.kritiksaran.index')
            ->with('success', 'Feedback berhasil dihapus');
    }
} 