<?php

namespace App\Http\Controllers\Admin;

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

class AgentHero2Controller extends Controller
{
    function index()
    {
        $data = AgentHero2::first();
        return view('admin.agent.hero.hero2', compact('data'));
    }

    function store(Request $request)
    {
        $request->validate([
            'title'=>['required'],
            'description1'=>['required'],
            'description2'=>['required'],
            'description3'=>['required'],
            'description4'=>['required'],
        ]);

        $data = AgentHero2::query()->updateOrCreate([
            'id'=>1
        ],
            $request->all()
        );

        $notification = array(
            'messege' => 'Updated successfully',
            'alert-type' => 'success'
        );
        return back()->with($notification);
    }
}
