mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-01 14:06:15 +00:00
Merge (#127)
This commit is contained in:
17
app/Actions/SourceControl/DeleteSourceControl.php
Normal file
17
app/Actions/SourceControl/DeleteSourceControl.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Actions\SourceControl;
|
||||
|
||||
use App\Models\SourceControl;
|
||||
|
||||
class DeleteSourceControl
|
||||
{
|
||||
public function delete(SourceControl $sourceControl): void
|
||||
{
|
||||
if ($sourceControl->sites()->exists()) {
|
||||
throw new \Exception('This source control is being used by a site.');
|
||||
}
|
||||
|
||||
$sourceControl->delete();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user