misc_pterodactyl-panel/app/Traits/Controllers/JavascriptInjection.php
Matthew Penner cbcf62086f
Upgrade to Laravel 9 (#4413)
Co-authored-by: DaneEveritt <dane@daneeveritt.com>
2022-10-14 10:59:20 -06:00

29 lines
536 B
PHP

<?php
namespace Pterodactyl\Traits\Controllers;
use JavaScript;
use Illuminate\Http\Request;
trait JavascriptInjection
{
private Request $request;
/**
* Set the request object to use when injecting JS.
*/
public function setRequest(Request $request): self
{
$this->request = $request;
return $this;
}
/**
* Injects the exact array passed in, nothing more.
*/
public function plainInject(array $args = []): string
{
return JavaScript::put($args);
}
}