app/Http/Controllers/ContactController.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(Request $request)
    {
        $data=request()->validate([
            'contact_heading'=>'',
            'Contact_Url'=>'',
            'outlet_heading'=>'',
                'Outlet_Url'=>'',
            'contact_button'=>'',
            'outlet_button'=>''
        ]);
        $id=auth()->user()->id;
        $con=Contact::create([
            'contact_heading'=>$data['contact_heading'],
            'Contact_Url'=>$data['Contact_Url'],
            'outlet_heading'=>$data['outlet_heading'],
            'Outlet_Url' =>$data['Outlet_Url'],
            'user_id'=>$id,
            'contact_button'=>$data['contact_button'],
            'outlet_button'=>$data['outlet_button']
        ]);
        return redirect('/contacts');
    }
public function store ( Request $ request ) { $ data = request ( ) -> validate ( [ 'contact_heading' => '' , 'Contact_Url' => '' , 'outlet_heading' => '' , 'Outlet_Url' => '' , 'contact_button' => '' , 'outlet_button' => '' ] ) ; $ id = auth ( ) -> user ( ) -> id ; $ con = Contact :: create ( [ 'contact_heading' => $ data [ 'contact_heading' ] , 'Contact_Url' => $ data [ 'Contact_Url' ] , 'outlet_heading' => $ data [ 'outlet_heading' ] , 'Outlet_Url' => $ data [ 'Outlet_Url' ] , 'user_id' => $ id , 'contact_button' => $ data [ 'contact_button' ] , 'outlet_button' => $ data [ 'outlet_button' ] ] ) ; return redirect ( '/contacts' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .