2017-09-03 02:35:33 +00:00
|
|
|
<?php
|
2017-09-26 02:43:01 +00:00
|
|
|
/**
|
2017-09-03 02:35:33 +00:00
|
|
|
* Pterodactyl - Panel
|
|
|
|
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
|
|
|
|
*
|
2017-09-26 02:43:01 +00:00
|
|
|
* This software is licensed under the terms of the MIT license.
|
|
|
|
* https://opensource.org/licenses/MIT
|
2017-09-03 02:35:33 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
namespace Pterodactyl\Traits\Controllers;
|
|
|
|
|
|
|
|
use Javascript;
|
2017-10-19 03:32:19 +00:00
|
|
|
use Illuminate\Http\Request;
|
2017-09-03 02:35:33 +00:00
|
|
|
|
2017-09-03 21:32:52 +00:00
|
|
|
trait JavascriptInjection
|
2017-09-03 02:35:33 +00:00
|
|
|
{
|
2017-10-21 02:32:57 +00:00
|
|
|
/**
|
|
|
|
* @var \Illuminate\Http\Request
|
|
|
|
*/
|
|
|
|
private $request;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the request object to use when injecting JS.
|
|
|
|
*
|
|
|
|
* @return $this
|
|
|
|
*/
|
|
|
|
public function setRequest(Request $request)
|
|
|
|
{
|
|
|
|
$this->request = $request;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2019-11-24 20:50:16 +00:00
|
|
|
/**
|
|
|
|
* Injects the exact array passed in, nothing more.
|
|
|
|
*
|
|
|
|
* @param array $args
|
2021-01-23 20:33:34 +00:00
|
|
|
*
|
2019-11-24 20:50:16 +00:00
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function plainInject($args = [])
|
|
|
|
{
|
|
|
|
return Javascript::put($args);
|
|
|
|
}
|
2017-09-03 02:35:33 +00:00
|
|
|
}
|