<?php

namespace App\Http\Controllers;

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

class RegisterController extends Controller
{
    //
     public function register(Request $request){
        $reg = New Registeration();
        $reg->name = $request->input('name');
        $reg->email = $request->input('email');
        $reg->phone = $request->input('phone');
        $reg->subject = $request->input('subject');
        $reg->message = $request->input('message');
        if($reg->save()){
            $request->session()->flash('message', 'Registered successfully');
        }else {
              $request->session()->flash('error', 'There is an error,please try again');  
            }
        return redirect()->back();    
     }

}
