misc_pterodactyl-panel/app/Http/Middleware/Activity/AccountSubject.php

23 lines
510 B
PHP
Raw Permalink Normal View History

<?php
2022-06-18 16:07:32 +00:00
namespace Pterodactyl\Http\Middleware\Activity;
use Closure;
use Illuminate\Http\Request;
use Pterodactyl\Facades\LogTarget;
2022-06-18 16:07:32 +00:00
class AccountSubject
{
/**
* Sets the actor and default subject for all requests passing through this
* middleware to be the currently logged in user.
*/
public function handle(Request $request, Closure $next)
{
LogTarget::setActor($request->user());
LogTarget::setSubject($request->user());
return $next($request);
}
}