Admin Panel
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-09-29 14:57:37 +07:00
parent 04fbddba13
commit 8c6dad2a31
94 changed files with 4864 additions and 1151 deletions
@@ -0,0 +1,47 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use App\Http\Requests\Admin\TestimonialRequest;
use App\Models\Testimonial;
use Illuminate\Http\RedirectResponse;
use Inertia\Inertia;
use Inertia\Response;
class TestimonialController extends Controller
{
public function index(): Response
{
return Inertia::render('admin/testimonials/index', [
'testimonials' => Testimonial::query()->orderBy('sort_order')->orderBy('id')->get(),
]);
}
public function store(TestimonialRequest $request): RedirectResponse
{
Testimonial::query()->create($request->validated());
Inertia::flash('toast', ['type' => 'success', 'message' => 'Testimoni ditambahkan.']);
return back();
}
public function update(TestimonialRequest $request, Testimonial $testimonial): RedirectResponse
{
$testimonial->update($request->validated());
Inertia::flash('toast', ['type' => 'success', 'message' => 'Testimoni diperbarui.']);
return back();
}
public function destroy(Testimonial $testimonial): RedirectResponse
{
$testimonial->delete();
Inertia::flash('toast', ['type' => 'success', 'message' => 'Testimoni dihapus.']);
return back();
}
}