app/Http/Controllers/InsuranceController.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)
    {
        $ins = new Insurance();
        $ins->name = $request->input('name');
        $ins->amount = $request->input('amount');
        $ins->user_id = Auth::user()->id;
        $ins->save();
        return redirect('/preferences');
    }
public function store ( Request $ request ) { $ ins = new Insurance ( ) ; $ ins -> name = $ request -> input ( 'name' ) ; $ ins -> amount = $ request -> input ( 'amount' ) ; $ ins -> user_id = Auth :: user ( ) -> id ; $ ins -> save ( ) ; return redirect ( '/preferences' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .