app/Http/Controllers/Admin/emailController.php
/**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
Store a newly created resource in storage.
Store a newly created resource in storage .
public function store(EmailValidator $request)
    {
        if($request->isMethod('post')){
            $data=$request->all();
            $email=new Email;
            $email->templatename=$data['templatename'];
            if(empty($data['emailtemplate'])){
                $email->emailtemplate="";
            }else{
                $email->emailtemplate=$data['emailtemplate'];
            }
        }
        $email->save();
        return redirect()->route('email.index')->with('success', 'Email created Successfully');
    }
public function store ( EmailValidator $ request ) { if ( $ request -> isMethod ( 'post' ) ) { $ data = $ request -> all ( ) ; $ email = new Email ; $ email -> templatename = $ data [ 'templatename' ] ; if ( empty ( $ data [ 'emailtemplate' ] ) ) { $ email -> emailtemplate = " " ; } else { $ email -> emailtemplate = $ data [ 'emailtemplate' ] ; } } $ email -> save ( ) ; return redirect ( ) -> route ( 'email.index' ) -> with ( 'success' , 'Email created Successfully' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .