i want to make a route to get them to GET method : <?php

// app/Http/Controllers/HomeController.php

namespace App\Http\Controllers;

use App\Models\Home;
use Illuminate\Http\Request;

class HomeController extends Controller
{
    // Get Hero Section Data
    public function getHeroSection()
    {
        $heroSection = Home::first(); // Assuming only one row for the homepage

        return response()->json([
            'status' => 'success',
            'data' => $heroSection
        ]);
    }

    // Update Hero Section Data
    public function updateHeroSection(Request $request)
    {
        $request->validate([
            'title' => 'required|string',
            'subtitle' => 'required|string',
            'cta_text' => 'required|string',
            'cta_button_text' => 'required|string',
            'call_us_text' => 'required|string',
            'facebook_social' => 'nullable|string',
            'instagram_social' => 'nullable|string',
            'email_social' => 'nullable|string',
            'tel_social' => 'nullable|string',
            'local_social' => 'nullable|string',
            'benefits' => 'required|array', // Ensure it's an array
        ]);

        // Convert benefits to JSON format
        $request->merge(['benefits' => json_encode($request->benefits)]);

        $heroSection = Home::first(); // Assuming only one row for the homepage

        if ($heroSection) {
            $heroSection->update($request->all());
        } else {
            $heroSection = Home::create($request->all());
        }

        return response()->json([
            'status' => 'success',
            'message' => 'Hero section updated successfully',
            'data' => $heroSection
        ]);
    }
} : <?php

// app/Http/Controllers/HomeController.php

namespace App\Http\Controllers;

use App\Models\Welcome;
use Illuminate\Http\Request;

class WelcomeController extends Controller
{
    // Get Hero Section Data
    public function getWelcomeSection()
    {
        $welcomeSection = Welcome::first(); // Assuming only one row for the homepage

        return response()->json([
            'status' => 'success',
            'data' => $welcomeSection
        ]);
    }

    public function updateWelcomeSection(Request $request)
    {
        $request->validate([
            'welcome_title' => 'required|string',
            'welcome_description' => 'required|string',
            'welcome_stitle' => 'required|string',
            'welcome_sdescription' => 'required|string',
            'cta_title' => 'required|string',
            'cta_description' => 'required|string',
            'bullets' => 'required|array', // Keep as array
            'cta_button' => 'required|string',
            'counter' => 'required|array'   // Keep as array
        ]);

        // Convert arrays to JSON strings
        $data = $request->all();
        $data['bullets'] = json_encode($data['bullets']); // Convert bullets to JSON
        $data['counter'] = json_encode($data['counter']); // Convert counter to JSON

        $welcomeSection = Welcome::first(); // Assuming only one row for the homepage

        if ($welcomeSection) {
            $welcomeSection->update($data);
        } else {
            $welcomeSection = Welcome::create($data);
        }

        return response()->json([
            'status' => 'success',
            'message' => 'Welcome section updated successfully',
            'data' => $welcomeSection
        ]);
    }
}