<?php

namespace App\Http\Controllers;

use App\Models\VisionMission;
use App\Http\Requests\StoreVisionMissionRequest;
use App\Http\Requests\UpdateVisionMissionRequest;

class VisionMissionController extends Controller
{
    /**
     * Display a listing of the resource.
     */
    public function index()
    {
        $item = VisionMission::first();
        return view('admin.pages.vision-mission', compact('item'));
    }

    /**
     * Show the form for creating a new resource.
     */
    public function create()
    {
        //
    }

    /**
     * Store a newly created resource in storage.
     */
    public function store(StoreVisionMissionRequest $request)
    {
        //
    }

    /**
     * Display the specified resource.
     */
    public function show(VisionMission $VisionMission)
    {
        //
    }

    /**
     * Show the form for editing the specified resource.
     */
    public function edit(VisionMission $VisionMission)
    {
        //
    }

    /**
     * Update the specified resource in storage.
     */
    public function update(UpdateVisionMissionRequest $request, VisionMission $VisionMission)
    {
        $data = $request->validated();

        $VisionMission->update($data);
        return redirect()->route('vision-missions.index')->with('success', 'Vision and Mission updated successfully.');
    }

    /**
     * Remove the specified resource from storage.
     */
    public function destroy(VisionMission $VisionMission)
    {
        //
    }
}
