app/Http/Controllers/Api/Admin/UserController.php
/**
     * Remove admin role from user.
     *
     * @param  UpdateRequest  $request
     * @return JsonResponse
     * @throws Throwable
     */
Remove admin role from user.
@param  UpdateRequest  $request
@return JsonResponse
@throws Throwable
Remove admin role from user . @param UpdateRequest $request @return JsonResponse @throws Throwable
private function removeRole(UpdateRequest $request)
    {
        DB::transaction(function () use ($request) {
            $admin = Admin::whereUserId($request->get('user')['id'])->first();
            $admin->delete();
            activity('admin')
                ->performedOn($admin)
                ->causedBy(auth()->user())
                ->withProperties($request->all())
                ->log('removed role from user');
        });
        return response()->json(['message' => __('User has been updated.')]);
    }
private function removeRole ( UpdateRequest $ request ) { DB :: transaction ( function ( ) use ( $ request ) { $ admin = Admin :: whereUserId ( $ request -> get ( 'user' ) [ 'id' ] ) -> first ( ) ; $ admin -> delete ( ) ; activity ( 'admin' ) -> performedOn ( $ admin ) -> causedBy ( auth ( ) -> user ( ) ) -> withProperties ( $ request -> all ( ) ) -> log ( 'removed role from user' ) ; } ) ; return response ( ) -> json ( [ 'message' => __ ( 'User has been updated.' ) ] ) ; }
Remove admin role from user.
Remove admin role from user .