<?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');
    }
}
