app/Http/Controllers/FooterController.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([
           'desc1'=>'required',
           'year'=>'required',
        ]);
        $user=auth()->user()->id;
        $foo=Footer::create([
            'desc1'=>$data['desc1'],
            'year'=>$data['year'],
            'user_id'=>$user,
        ]);
        return redirect('/footer');
    }
public function store ( Request $ request ) { $ data = request ( ) -> validate ( [ 'desc1' => 'required' , 'year' => 'required' , ] ) ; $ user = auth ( ) -> user ( ) -> id ; $ foo = Footer :: create ( [ 'desc1' => $ data [ 'desc1' ] , 'year' => $ data [ 'year' ] , 'user_id' => $ user , ] ) ; return redirect ( '/footer' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .