app/Http/Controllers/Dashboard/AddstoreController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request, $id)
    {
        if($request->hasFile('logo')){
            $filenameWithExtention=$request->file('logo')
            ->getClientOriginalName();
            $fileName=pathinfo($filenameWithExtention,
            PATHINFO_FILENAME) ;
            $max_file_uploads=500;
            $extension=$request->file('logo')->getClientOriginalExtension();
            $fileNameStore=$fileName .'_'.time().'.'.$extension;
            $request->file('logo')->move(public_path('uploads/images/images'),$fileNameStore);
        }else{
            $fileNameStore="noImage.jpg";
        }
        $post= AddStore::find($id);
        $post->tsnef=$request->tsnef;
        $post->store_name=$request->store_name;
        $post->store_address=$request->store_address;
        $post->Governorate=$request->Governorate;
        $post->City=$request->City;
        $post->logo=$fileNameStore;
        $post->long_map=$request->lang_map;
        $post->lat_map=$request->lat_map;
        $Employee= $post->save();
        notify_msg('success','تم التعديل بنجاح');
        return redirect('admin/addstore');
    }
public function update ( Request $ request , $ id ) { if ( $ request -> hasFile ( 'logo' ) ) { $ filenameWithExtention = $ request -> file ( 'logo' ) -> getClientOriginalName ( ) ; $ fileName = pathinfo ( $ filenameWithExtention , PATHINFO_FILENAME ) ; $ max_file_uploads = 500 ; $ extension = $ request -> file ( 'logo' ) -> getClientOriginalExtension ( ) ; $ fileNameStore = $ fileName . '_' . time ( ) . '.' . $ extension ; $ request -> file ( 'logo' ) -> move ( public_path ( 'uploads/images/images' ) , $ fileNameStore ) ; } else { $ fileNameStore = " noImage.jpg " ; } $ post = AddStore :: find ( $ id ) ; $ post -> tsnef = $ request -> tsnef ; $ post -> store_name = $ request -> store_name ; $ post -> store_address = $ request -> store_address ; $ post -> Governorate = $ request -> Governorate ; $ post -> City = $ request -> City ; $ post -> logo = $ fileNameStore ; $ post -> long_map = $ request -> lang_map ; $ post -> lat_map = $ request -> lat_map ; $ Employee = $ post -> save ( ) ; notify_msg ( 'success' , 'تم التعديل بنجاح'); return redirect ( 'admin/addstore' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .
//  $path=$request->file('post_image')->storeAs('public/uploads/images',$fileNameStore);