reorganize and cleanup php server code

This commit is contained in:
2026-02-06 13:12:38 +01:00
parent bf2f18f847
commit a6785f26db
3103 changed files with 494 additions and 351462 deletions
@@ -0,0 +1,43 @@
<?php
namespace Vanguard\Http\Controllers\Web\Profile;
use Vanguard\Http\Controllers\Controller;
use Vanguard\Repositories\Session\SessionRepository;
/**
* Class SessionsController
* @package Vanguard\Http\Controllers\Web\Profile
*/
class SessionsController extends Controller
{
public function __construct(private SessionRepository $sessions)
{
}
/**
* Get sessions for specified user.
*/
public function index()
{
return view('user.sessions', [
'profile' => true,
'user' => auth()->user(),
'sessions' => $this->sessions->getUserSessions(auth()->id())
]);
}
/**
* Invalidate user's session.
*
* @param $session \stdClass Session object.
* @return mixed
*/
public function destroy($session)
{
$this->sessions->invalidateSession($session->id);
return redirect()->route('profile.sessions')
->withSuccess(__('Session invalidated successfully.'));
}
}