app/Http/Controllers/NavitemController.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,$n_id)
    {
        $data=request()->validate([
           'nav_name'=>'required',
           'nav_url'=>'required',
        ]);
        $nav=Navitem::create([
           'nav_name'=>$data['nav_name'],
           'nav_url'=>$data['nav_url'],
            'navigation_id'=>$n_id
        ]);
        return redirect('/navitem');
    }
public function store ( Request $ request , $ n_id ) { $ data = request ( ) -> validate ( [ 'nav_name' => 'required' , 'nav_url' => 'required' , ] ) ; $ nav = Navitem :: create ( [ 'nav_name' => $ data [ 'nav_name' ] , 'nav_url' => $ data [ 'nav_url' ] , 'navigation_id' => $ n_id ] ) ; return redirect ( '/navitem' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .