vito/app/SSHCommands/Database/RestoreDatabaseCommand.php
2023-08-04 18:28:04 +02:00

27 lines
655 B
PHP

<?php
namespace App\SSHCommands\Database;
use App\SSHCommands\Command;
use Illuminate\Support\Facades\File;
class RestoreDatabaseCommand extends Command
{
public function __construct(protected string $provider, protected string $database, protected string $fileName)
{
}
public function file(): string
{
return File::get(resource_path(sprintf("commands/database/%s/restore.sh", $this->provider)));
}
public function content(): string
{
return str($this->file())
->replace('__database__', $this->database)
->replace('__file__', $this->fileName)
->toString();
}
}