TRF Certest first commit

This commit is contained in:
2025-02-26 08:57:46 +01:00
commit 3ce064a108
2524 changed files with 475404 additions and 0 deletions
@@ -0,0 +1,37 @@
<?php
namespace Vanguard\Http\Controllers\Api;
use Illuminate\Auth\Access\AuthorizationException;
use Vanguard\Http\Resources\SessionResource;
use Vanguard\Repositories\Session\SessionRepository;
class SessionsController extends ApiController
{
public function __construct(private readonly SessionRepository $sessions)
{
$this->middleware('session.database');
}
/**
* @throws AuthorizationException
*/
public function show($session): SessionResource
{
$this->authorize('manage-session', $session);
return new SessionResource($session);
}
/**
* @throws AuthorizationException
*/
public function destroy($session): \Illuminate\Http\JsonResponse
{
$this->authorize('manage-session', $session);
$this->sessions->invalidateSession($session->id);
return $this->respondWithSuccess();
}
}