File manager - Edit - /var/www/html/gop/api/app/Console/Commands/CriarPastas.php
Back
<?php namespace App\Console\Commands; use Illuminate\Console\Command; class CriarPastas extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'criar-pastas'; /** * The console command description. * * @var string */ protected $description = 'Cria as pastas necessarias para o projeto.'; /** * Execute the console command. * * @return int */ public function handle() { $this->createDirectories([ storage_path().'/app/public/assets', storage_path().'/app/public/assets/prestadores', storage_path().'/app/public/assets/prestadores/assinaturas', ]); return Command::SUCCESS; } public function createDirectories(string|array $paths) { if (! is_array($paths)) { $paths = [$paths]; } foreach ($paths as $path) { if (! file_exists($path)) { mkdir($path); echo "Diretorio storage '$path' criado com sucesso! \n"; } else { echo "Diretorio storage '$path' ja existe! \n"; } } } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.28 | Generation time: 0.01 |
proxy
|
phpinfo
|
Settings