Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pterodactyl
GitHub Repository: pterodactyl/panel
Path: blob/1.0-develop/app/Traits/Controllers/JavascriptInjection.php
10262 views
1
<?php
2
3
namespace Pterodactyl\Traits\Controllers;
4
5
use Illuminate\Http\Request;
6
7
trait JavascriptInjection
8
{
9
private Request $request;
10
11
/**
12
* Set the request object to use when injecting JS.
13
*/
14
public function setRequest(Request $request): self
15
{
16
$this->request = $request;
17
18
return $this;
19
}
20
21
/**
22
* Injects the exact array passed in, nothing more.
23
*/
24
public function plainInject(array $args = []): string
25
{
26
return \JavaScript::put($args);
27
}
28
}
29
30