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

22 lines
498 B
PHP
Raw Normal View History

<?php
2022-06-18 16:07:32 +00:00
namespace Pterodactyl\Http\Middleware\Activity;
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.
*/
2022-11-29 17:53:59 +00:00
public function handle(Request $request, \Closure $next)
{
LogTarget::setActor($request->user());
LogTarget::setSubject($request->user());
return $next($request);
}
}