We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2e0ac36 commit 65bfd55Copy full SHA for 65bfd55
app/Http/Controllers/DomainController.php
@@ -151,12 +151,17 @@ public function destroy(Domain $domain)
151
// Has measures ?
152
if (DB::table('measures')
153
->where('domain_id', $domain->id)
154
+ ->join('control_measure','measures.id','control_measure.measure_id')
155
->exists()) {
156
return back()
- ->withErrors(['msg' => 'There are controls associated with this framework !'])
157
+ ->withErrors(['msg' => 'There are measures associated with this framework !'])
158
->withInput();
159
}
160
161
+ // Delete measures
162
+ DB::table('measures')->where('domain_id', $domain->id)->delete();
163
+
164
+ // Delete domain
165
$domain->delete();
166
167
return redirect('/domains');
0 commit comments