Laravel Hetzner Storagebox

PHP MIT

Production-ready Laravel package for integrating Hetzner Storage Box into Laravel applications using the native Storage facade and filesystem API.

Stars
19
Forks
0
Downloads
2,357
Open Issues
0
Files main

Repository Files

Loading file structure...
src/Console/InstallCommand.php
<?php

namespace GhostCompiler\Hetzner\StorageBox\Console;

use Illuminate\Console\Command;

class InstallCommand extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'ghost:storagebox {action=install}';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Install the Hetzner Storage Box SDK config file';

    /**
     * Execute the console command.
     *
     * @return int
     */
    public function handle()
    {
        $action = $this->argument('action');

        if ($action !== 'install') {
            $this->error("Unknown action: {$action}");

            return 1;
        }

        $this->info('Installing Hetzner Storage Box SDK...');

        $this->call('vendor:publish', [
            '--provider' => 'GhostCompiler\Hetzner\StorageBox\Providers\HetznerStorageBoxServiceProvider',
            '--tag' => 'config',
        ]);

        $this->info('Config file published successfully!');

        return 0;
    }
}