public function detailsJSON($lang, $id)
    {
        // check if user has permissions to access this link
        if(\Illuminate\Support\Facades\Auth::user()->userID != $id) {
            if (!User::hasAccess('User', 'read')) {
                return $this->noPermission();
            }
        }

        $user = App\Models\User::with('roles', 'profileImage')->find($id)->appendLanguageKeys();
        $final = [
          'details' => $user,
          'allGroups' => UserGroup::all()
        ];

        // Fire event
        $final['events'] = Event::fire('user:pre_update', [$final]);
        return $final;
    }
public function detailsJSON($lang, $id)
    {
        // check if user has permissions to access this link
        if(\Illuminate\Support\Facades\Auth::user()->userID != $id) {
            if (!User::hasAccess('User', 'read')) {
                return $this->noPermission();
            }
        }

        $user = App\Models\User::with('roles', 'profileImage')->find($id)->appendLanguageKeys();
        $final = [
          'details' => $user,
          'allGroups' => UserGroup::all()
        ];

        // Fire event
        $final['events'] = Event::fire('user:pre_update', [$final]);
        return $final;
    }
public function detailsJSON ( $ lang , $ id ) { // check if user has permissions to access this link if ( \ Illuminate \ Support \ Facades \ Auth :: user ( ) -> userID != $ id ) { if ( ! User :: hasAccess ( 'User' , 'read' ) ) { return $ this -> noPermission ( ) ; } } $ user = App \ Models \ User :: with ( 'roles' , 'profileImage' ) -> find ( $ id ) -> appendLanguageKeys ( ) ; $ final = [ 'details' => $ user , 'allGroups' => UserGroup :: all ( ) ] ; // Fire event $ final [ 'events' ] = Event :: fire ( 'user:pre_update' , [ $ final ] ) ; return $ final ; }
JSON object with details for a specific user.

@param  string $lang
@param  int    $id
@return array
JSON object with details for a specific user .