<?php

namespace App\Http\Controllers;

use App\News;
use Illuminate\Http\Request;

class NewsController extends Controller
{
    public function index(Request $request){
        $email = $request->news ;
        $check = News::where('email' ,'=', $email)->first();
        if($check == null){
            $news = new News();
        $news->email = $email;
        $news->save();
       
        }
        return redirect()->back();
    }
}
