<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use Illuminate\Support\Facades\DB;

use App\history;
use App\elink;
use App\form;
use App\implink;
use App\notice;
use App\slider;
use App\gallery;
use App\admission;
use App\routine;
use App\result;
use App\contact;
use App\schedule;
use App\speech;
use App\User;
use App\Episode;
use App\Guest;
use App\Specialguest;
use App\Judge;
use App\Mark;
use App\Question;
use App\Quizepermission;
use App\Specialmoment;
use Illuminate\Support\Facades\Redirect;

class SpecialmomentController extends Controller
{
    public function create(){

        
        return view('admin/specialmomentcreate');
    }


    public function store(Request $request){
       //dd($request);
        $specialmoment               =  new Specialmoment();
        $specialmoment    ->round_id = $request->input('round_id');
        $specialmoment    ->captions = $request->input('captions');
        $specialmoment    ->picture = $request->input('picture');

     if($specialmoment->hasFile('picture')){
                $originalFiles = $request->file('picture');
                $image = $originalFiles;
                $filename = time().'.'.$image->getClientOriginalExtension();
                $destinationPath = public_path('/images');
                $image->move($destinationPath, $filename);
                $specialmoment->picture = $filename;
                 }
    
        $specialmoment->save();
   
    return redirect('admin/quistions');
   }

}