����JFIF��x�x����'
Server IP : 66.29.137.217 / Your IP : 3.149.230.241 Web Server : LiteSpeed System : Linux premium294.web-hosting.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64 User : gltevjme ( 1095) PHP Version : 7.0.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/gltevjme/./cbt.gltechlimited.com/vendor/tightenco/ziggy/src/ |
Upload File : |
<?php namespace Tightenco\Ziggy; use Illuminate\Console\Command; use Illuminate\Filesystem\Filesystem; use Tightenco\Ziggy\Ziggy; class CommandRouteGenerator extends Command { protected $signature = 'ziggy:generate {path=./resources/js/ziggy.js} {--url=} {--group=}'; protected $description = 'Generate js file for including in build process'; protected $files; public function __construct(Filesystem $files) { parent::__construct(); $this->files = $files; } public function handle() { $path = $this->argument('path'); $generatedRoutes = $this->generate($this->option('group')); $this->makeDirectory($path); $this->files->put(base_path($path), $generatedRoutes); $this->info('File generated!'); } private function generate($group = false) { $payload = (new Ziggy($group, $this->option('url') ? url($this->option('url')) : null))->toJson(); return <<<JAVASCRIPT const Ziggy = {$payload}; if (typeof window !== 'undefined' && typeof window.Ziggy !== 'undefined') { for (let name in window.Ziggy.routes) { Ziggy.routes[name] = window.Ziggy.routes[name]; } } export { Ziggy }; JAVASCRIPT; } protected function makeDirectory($path) { if (! $this->files->isDirectory(dirname(base_path($path)))) { $this->files->makeDirectory(dirname(base_path($path)), 0777, true, true); } return $path; } }