app/Http/Controllers/Api/v1/AdminController.php
/**
     * Mobile Application Authentication Logout.
     *
     * @param Request $request
     * @return JsonResponse
     */
Mobile Application Authentication Logout.
@param Request $request
@return JsonResponse
Mobile Application Authentication Logout . @param Request $request @return JsonResponse
public function logout(Request $request)
    {
        $validatedData = $request->validate([
            'User_id' => "required",
            'device_name' => 'required'
        ]);
        $User = User::find($request->User_id);
        $User->tokens()->where('name', $request->device_name)->delete();
        return response()->json(null, 204);
    }
public function logout ( Request $ request ) { $ validatedData = $ request -> validate ( [ 'User_id' => " required " , 'device_name' => 'required' ] ) ; $ User = User :: find ( $ request -> User_id ) ; $ User -> tokens ( ) -> where ( 'name' , $ request -> device_name ) -> delete ( ) ; return response ( ) -> json ( null , 204 ) ; }
Mobile Application Authentication Logout.
Mobile Application Authentication Logout .