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
db162596
Commit
db162596
authored
Jun 11, 2020
by
alinetenorio
Browse files
sair de projeto
parent
d5d47167
Changes
5
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/TrabalhoController.php
View file @
db162596
...
...
@@ -539,6 +539,16 @@ class TrabalhoController extends Controller
return
redirect
()
->
back
();
}
public
function
excluirParticipante
(
$id
){
$participante
=
Participante
::
where
(
'user_id'
,
Auth
()
->
user
()
->
id
)
->
where
(
'trabalho_id'
,
$id
)
->
first
();
$participante
->
trabalhos
()
->
detach
(
$id
);
$participante
->
delete
();
return
redirect
()
->
back
();
}
public
function
novaVersao
(
Request
$request
){
$mytime
=
Carbon
::
now
(
'America/Recife'
);
$mytime
=
$mytime
->
toDateString
();
...
...
app/Participante.php
View file @
db162596
...
...
@@ -3,9 +3,12 @@
namespace
App
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Database\Eloquent\SoftDeletes
;
class
Participante
extends
Model
{
use
SoftDeletes
;
protected
$fillable
=
[
'name'
,
'user_id'
,
'trabalho_id'
,
'participante_id'
];
public
function
user
(){
...
...
database/migrations/2020_05_23_054945_create_participantes_table.php
View file @
db162596
...
...
@@ -25,6 +25,8 @@ class CreateParticipantesTable extends Migration
$table
->
unsignedBigInteger
(
'funcao_participante_id'
)
->
nullable
();
$table
->
foreign
(
'funcao_participante_id'
)
->
references
(
'id'
)
->
on
(
'funcao_participantes'
);
$table
->
softDeletes
();
});
}
...
...
resources/views/participante/projetos.blade.php
View file @
db162596
...
...
@@ -51,7 +51,7 @@
Visualizar
projeto
</
a
>
@
if
(
$projeto
->
status
==
'Submetido'
)
<
a
href
=
"{{ route('trabalho.
destroy
', ['id' =>
$projeto->id
]) }}"
class
=
"dropdown-item"
style
=
"text-align: center"
>
<
a
href
=
"{{ route('trabalho.
excluirParticipante
', ['id' =>
$projeto->id
]) }}"
class
=
"dropdown-item"
style
=
"text-align: center"
>
Sair
do
projeto
</
a
>
@
endif
...
...
routes/web.php
View file @
db162596
...
...
@@ -96,6 +96,7 @@ Route::group(['middleware' => ['isTemp', 'auth', 'verified']], function(){
Route
::
get
(
'/projeto/{id}/editar'
,
'TrabalhoController@edit'
)
->
name
(
'trabalho.editar'
);
Route
::
post
(
'/projeto/{id}/atualizar'
,
'TrabalhoController@update'
)
->
name
(
'trabalho.update'
);
Route
::
get
(
'/projeto/{id}/excluir'
,
'TrabalhoController@destroy'
)
->
name
(
'trabalho.destroy'
);
Route
::
get
(
'/projeto/{id}/excluirParticipante'
,
'TrabalhoController@excluirParticipante'
)
->
name
(
'trabalho.excluirParticipante'
);
//######### Atribuição #######################################
Route
::
get
(
'/atribuir'
,
'AtribuicaoController@distribuicaoAutomatica'
)
->
name
(
'distribuicao'
);
...
...
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