Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Walter Felipe
submeta
Commits
51c0c25c
Commit
51c0c25c
authored
Feb 06, 2023
by
Yuri Resende
Browse files
Adicionando verificação na exclusão das ODSs
parent
67245ec5
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/ObjetivoDeDesenvolvimentoSustentavelController.php
View file @
51c0c25c
...
@@ -41,8 +41,12 @@ class ObjetivoDeDesenvolvimentoSustentavelController extends Controller
...
@@ -41,8 +41,12 @@ class ObjetivoDeDesenvolvimentoSustentavelController extends Controller
public
function
destroy
(
$id
)
public
function
destroy
(
$id
)
{
{
$ODS
=
ObjetivoDeDesenvolvimentoSustentavel
::
find
(
$id
);
$ODS
=
ObjetivoDeDesenvolvimentoSustentavel
::
find
(
$id
);
$ODS
->
delete
();
if
(
$ODS
->
trabalhos
()
->
first
()){
return
redirect
(
route
(
'grandearea.index'
)
)
->
with
([
'error'
=>
'Não foi possível excluir a ODS. Existe um ou mais trabalhos vinculados a ODS'
]);
}
$ODS
->
delete
();
return
redirect
(
route
(
'grandearea.index'
)
)
->
with
([
'mensagem'
=>
'ODS excluido com sucesso'
]);
return
redirect
(
route
(
'grandearea.index'
)
)
->
with
([
'mensagem'
=>
'ODS excluido com sucesso'
]);
}
}
}
}
resources/views/naturezas/grandeArea/index.blade.php
View file @
51c0c25c
...
@@ -3,6 +3,15 @@
...
@@ -3,6 +3,15 @@
@
section
(
'content'
)
@
section
(
'content'
)
<
div
class
=
"container"
>
<
div
class
=
"container"
>
<
div
class
=
"row"
>
@
if
(
session
(
'error'
))
<
div
class
=
"col-md-12"
style
=
"margin-top: 30px;"
>
<
div
class
=
"alert alert-danger"
>
<
p
>
{{
session
(
'error'
)}}
</
p
>
</
div
>
</
div
>
@
endif
</
div
>
<
div
class
=
"row"
>
<
div
class
=
"row"
>
@
if
(
session
(
'mensagem'
))
@
if
(
session
(
'mensagem'
))
<
div
class
=
"col-md-12"
style
=
"margin-top: 30px;"
>
<
div
class
=
"col-md-12"
style
=
"margin-top: 30px;"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment