Files
budget_analyser/app/Console/Commands/page.php
2024-01-27 10:32:55 +01:00

33 lines
870 B
PHP

<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class page extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'page:new {name}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Create Inertia page folder with .vue and .scss files';
/**
* Execute the console command.
*/
public function handle()
{
shell_exec('mkdir '.getcwd().'\resources\js\Pages\\'.$this->argument('name'));
shell_exec('echo. > '.getcwd().'\resources\js\Pages\\'.$this->argument('name').'\\'.strtolower($this->argument('name')).'.vue');
shell_exec('echo. > '.getcwd().'\resources\js\Pages\\'.$this->argument('name').'\\'.strtolower($this->argument('name')).'.scss');
}
}