<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use App\Models\IndexVideo;
use Illuminate\Http\Request;
use Brian2694\Toastr\Facades\Toastr;

class AdminStaticVideoController extends Controller
{
     //Course View
     public function AdminStaticVideo()
     {
         $videos = IndexVideo::latest()->get();
         return view('admin.videos.index_video', compact('videos'));
     }
 
     //Course Add
     public function AdminStaticVideoStore(Request $request)
     {
         $request->validate([
             'link' => 'max:255|required',
         ]);
         $course_store = IndexVideo::find(1);
         $course_store->link = $request->link;
         $course_store->save();
         Toastr::success('Video Updated Successfully');
         return redirect()->back();
     }
 
    
}
