Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
1 contributor

Users who have contributed to this file

24 lines (19 sloc) 450 Bytes
<?php
namespace App\Http\Controllers\API\Auth;
use App\Http\Controllers\Controller;
class LogoutController extends Controller
{
/**
* Log a user out.
*
* @return \Illuminate\Http\JsonResponse
*/
public function __invoke()
{
$user = auth()->user();
foreach ($user->tokens as $token) {
$token->delete();
}
return response()->json('Logged out successfully', 200);
}
}
You can’t perform that action at this time.