Files
expose/app/Commands/PublishCommand.php
Marcel Pociot 6a47264be9 wip
2020-06-02 16:51:36 +02:00

31 lines
729 B
PHP

<?php
namespace App\Commands;
use Illuminate\Console\Command;
class PublishCommand extends Command
{
protected $signature = 'publish';
protected $description = 'Publish the expose configuration file';
public function handle()
{
$configFile = implode(DIRECTORY_SEPARATOR, [
$_SERVER['HOME'],
'.expose',
'config.php'
]);
if (file_exists($configFile)) {
$this->error('Expose configuration file already exists at '.$configFile);
return;
}
file_put_contents($configFile, file_get_contents(base_path('config/expose.php')));
$this->info('Published expose configuration file to: ' . $configFile);
}
}