misc_pterodactyl-panel/app/Traits/Controllers/JavascriptInjection.php
Matthew Penner 3ea6d45cda
php-cs-fixer
2022-11-29 10:53:59 -07:00

28 lines
521 B
PHP

<?php
namespace Pterodactyl\Traits\Controllers;
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);
}
}