Skip to content

Commit

Permalink
Merge pull request #140 from dbarzin/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
dbarzin authored Sep 25, 2024
2 parents 1644668 + edc03e7 commit a9183ab
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
14 changes: 7 additions & 7 deletions app/Http/Controllers/DomainController.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,13 @@ public function destroy(Domain $domain)
abort_if(Auth::User()->role !== 1, Response::HTTP_FORBIDDEN, '403 Forbidden');

// Has measures ?
abort_if(
DB::table('measures')
->where('domain_id', $domain->id)
->exists(),
Response::HTTP_FORBIDDEN,
'403 Forbidden'
);
if (DB::table('measures')
->where('domain_id', $domain->id)
->exists()) {
return back()
->withErrors(['msg' => 'There are controls associated with this framework !'])
->withInput();
}

$domain->delete();

Expand Down
11 changes: 11 additions & 0 deletions resources/views/domains/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
@section("content")
<div class="p-3">
<div data-role="panel" data-title-caption="{{ trans('cruds.domain.show') }}" data-collapsible="true" data-title-icon="<span class='mif-chart-line'></span>">
@if (count($errors))
<div class="grid">
<div class="cell-5 bg-red fg-white">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
</div>
@endif
<div class="grid">
<div class="row">
<div class="cell-1">
Expand Down

0 comments on commit a9183ab

Please sign in to comment.