mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-19 18:01:37 +00:00
22 lines
432 B
PHP
22 lines
432 B
PHP
<?php
|
|
|
|
namespace App\Actions\StorageProvider;
|
|
|
|
use App\Models\StorageProvider;
|
|
use Exception;
|
|
|
|
class DeleteStorageProvider
|
|
{
|
|
/**
|
|
* @throws Exception
|
|
*/
|
|
public function delete(StorageProvider $storageProvider): void
|
|
{
|
|
if ($storageProvider->backups()->exists()) {
|
|
throw new Exception('This storage provider is being used by a backup.');
|
|
}
|
|
|
|
$storageProvider->delete();
|
|
}
|
|
}
|