app/Http/Controllers/NavigationController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\Navigation  $navigation
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request, Navigation $navigation)
    {
        $data=request()->validate([
            'logo'=>'required'
        ]);
        $id=auth()->user()->id;
        $imagePath = request('logo')->store('NavigationLogo', 'public');
        $image = Image::make("storage/{$imagePath}")->fit(100, 100);
        $nav=array_merge($data,['logo'=>$imagePath,'user_id'=>$id]);
        $navigation->update($nav);
        return redirect('/navigation');
    }
public function update ( Request $ request , Navigation $ navigation ) { $ data = request ( ) -> validate ( [ 'logo' => 'required' ] ) ; $ id = auth ( ) -> user ( ) -> id ; $ imagePath = request ( 'logo' ) -> store ( 'NavigationLogo' , 'public' ) ; $ image = Image :: make ( " storage/ { $ imagePath } " ) -> fit ( 100 , 100 ) ; $ nav = array_merge ( $ data , [ 'logo' => $ imagePath , 'user_id' => $ id ] ) ; $ navigation -> update ( $ nav ) ; return redirect ( '/navigation' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .