Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 22s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 13s
Laravel Pint / pint (pull_request) Successful in 2m32s
Laravel Larastan / larastan (pull_request) Failing after 6m55s
36 lines
666 B
PHP
36 lines
666 B
PHP
<?php
|
|
|
|
namespace App\Services;
|
|
|
|
use Illuminate\Support\Facades\Storage;
|
|
|
|
class SftpFileService
|
|
{
|
|
protected $disk;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->disk = Storage::disk('ftp');
|
|
}
|
|
|
|
public function getFiles(): array
|
|
{
|
|
return $this->disk->files();
|
|
}
|
|
|
|
public function getFileContent(string $file): string
|
|
{
|
|
return $this->disk->get($file);
|
|
}
|
|
|
|
public function moveFile(string $file, string $destination): bool
|
|
{
|
|
return $this->disk->move($file, $destination);
|
|
}
|
|
|
|
// public function deleteFile(string $file): bool
|
|
// {
|
|
// return $this->disk->delete($file);
|
|
// }
|
|
}
|