app/Http/Controllers/userController.php
/**
     *   dropzone Upload Image 
     *   Use Laravel media Library
     */
dropzone Upload Image
Use Laravel media Library
dropzone Upload Image Use Laravel media Library
public function uploadImage(Request $request)
    {
         \Log::info($request);
            $users = Users::find($request->user_id);
            if($request->avatar != NULL){
                $users->clearMediaCollection('avatar');
                $users->addMediaFromRequest('avatar')->toMediaCollection('avatar');
            }
        return response()->json(['Message'=>'success', 'status'=>(int)true]);
    }
public function uploadImage ( Request $ request ) { \ Log :: info ( $ request ) ; $ users = Users :: find ( $ request -> user_id ) ; if ( $ request -> avatar != NULL ) { $ users -> clearMediaCollection ( 'avatar' ) ; $ users -> addMediaFromRequest ( 'avatar' ) -> toMediaCollection ( 'avatar' ) ; } return response ( ) -> json ( [ 'Message' => 'success' , 'status' => ( int ) true ] ) ; }
dropzone Upload Image
   Use Laravel media Library
dropzone Upload Image Use Laravel media Library