vito/app/Actions/ServerProvider/DeleteServerProvider.php
Saeed Vaziry a406491160
increase test coverage (#117)
70% test coverage
remove socialite
2024-03-15 22:23:45 +01:00

22 lines
424 B
PHP

<?php
namespace App\Actions\ServerProvider;
use App\Models\ServerProvider;
use Exception;
class DeleteServerProvider
{
/**
* @throws Exception
*/
public function delete(ServerProvider $serverProvider): void
{
if ($serverProvider->servers()->exists()) {
throw new Exception('This server provider is being used by a server.');
}
$serverProvider->delete();
}
}