| Total Complexity | 6 |
| Total Lines | 73 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | class Assets |
||
| 25 | { |
||
| 26 | /** |
||
| 27 | * $script |
||
| 28 | * |
||
| 29 | * @var array |
||
| 30 | */ |
||
| 31 | public static $script = []; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * $css |
||
| 35 | * |
||
| 36 | * @var array |
||
| 37 | */ |
||
| 38 | public static $css = []; |
||
| 39 | |||
| 40 | /** |
||
| 41 | * $js |
||
| 42 | * |
||
| 43 | * @var array |
||
| 44 | */ |
||
| 45 | public static $js = []; |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Add css or get all css. |
||
| 49 | * |
||
| 50 | * @param null $css css |
||
|
|
|||
| 51 | * |
||
| 52 | * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View|void |
||
| 53 | */ |
||
| 54 | public static function css($css = null) |
||
| 63 | } |
||
| 64 | |||
| 65 | /** |
||
| 66 | * Add js or get all js. |
||
| 67 | * |
||
| 68 | * @param null $js |
||
| 69 | * |
||
| 70 | * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View|void |
||
| 71 | */ |
||
| 72 | public static function js($js = null) |
||
| 73 | { |
||
| 74 | if (!is_null($js)) { |
||
| 75 | self::$js = array_merge(self::$js, (array) $js); |
||
| 76 | |||
| 77 | return; |
||
| 78 | } |
||
| 79 | |||
| 80 | return view('backend.partials.js', ['js' => array_unique(static::$js)]); |
||
| 81 | } |
||
| 82 | |||
| 83 | /** |
||
| 84 | * @param string $script |
||
| 85 | * |
||
| 86 | * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View|void |
||
| 87 | */ |
||
| 88 | public static function script($script = '') |
||
| 97 | } |
||
| 98 | } |
||
| 99 |