TA_POLIJECARE_E31231389/backend/app/Http/Controllers/API/HeroController.php

28 lines
557 B
PHP

<?php
namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller;
use App\Models\HeroSection;
use Illuminate\Http\Request;
class HeroController extends Controller
{
public function index()
{
$hero = HeroSection::first();
if (!$hero) {
return response()->json([
'success' => false,
'message' => 'Hero section not found'
], 404);
}
return response()->json([
'success' => true,
'data' => $hero
]);
}
}