/home/techb158/ileadtechnology.com/vendor/spatie/laravel-backup/src/BackupDestination
Edit: /home/techb158/ileadtechnology.com/vendor/spatie/laravel-backup/src/BackupDestination/Backup.php (2130B)
disk = $disk;
$this->path = $path;
$this->exists = true;
}
public function disk(): Filesystem
{
return $this->disk;
}
public function path(): string
{
return $this->path;
}
public function exists(): bool
{
if ($this->exists === null) {
$this->exists = $this->disk->exists($this->path);
}
return $this->exists;
}
public function date(): Carbon
{
if ($this->date === null) {
try {
// try to parse the date from the filename
$basename = basename($this->path);
$this->date = Carbon::createFromFormat(BackupJob::FILENAME_FORMAT, $basename);
} catch (InvalidArgumentException $e) {
// if that fails, ask the (remote) filesystem
$this->date = Carbon::createFromTimestamp($this->disk->lastModified($this->path));
}
}
return $this->date;
}
/**
* Get the size in bytes.
*/
public function size(): float
{
if ($this->size === null) {
if (! $this->exists()) {
return 0;
}
$this->size = $this->disk->size($this->path);
}
return $this->size;
}
public function stream()
{
return $this->disk->readStream($this->path);
}
public function delete()
{
$this->disk->delete($this->path);
$this->exists = false;
consoleOutput()->info("Deleted backup `{$this->path}`.");
}
}