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
89078619
Commit
89078619
authored
Jun 09, 2020
by
Gabriel-31415
Browse files
excluir projeto
parent
209b7583
Changes
8
Hide whitespace changes
Inline
Side-by-side
app/Avaliador.php
View file @
89078619
...
...
@@ -3,9 +3,11 @@
namespace
App
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Database\Eloquent\SoftDeletes
;
class
Avaliador
extends
Model
{
use
SoftDeletes
;
protected
$fillable
=
[
'status'
,
'parecer'
,
...
...
app/Http/Controllers/TrabalhoController.php
View file @
89078619
...
...
@@ -505,9 +505,12 @@ class TrabalhoController extends Controller
* @param \App\Trabalho $trabalho
* @return \Illuminate\Http\Response
*/
public
function
destroy
(
Trabalho
$trabalho
)
public
function
destroy
(
Request
$request
)
{
//
$trabalho
=
Trabalho
::
find
(
$request
->
id
);
//dd($trabalho);
$trabalho
->
delete
();
return
redirect
()
->
back
();
}
public
function
novaVersao
(
Request
$request
){
...
...
app/Trabalho.php
View file @
89078619
...
...
@@ -3,9 +3,12 @@
namespace
App
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Database\Eloquent\SoftDeletes
;
class
Trabalho
extends
Model
{
use
SoftDeletes
;
/**
* The attributes that are mass assignable.
*
...
...
@@ -38,6 +41,8 @@ class Trabalho extends Model
'pivot'
,
];
public
function
recurso
(){
return
$this
->
hasMany
(
'App\Recurso'
,
'trabalhoId'
);
}
...
...
database/migrations/2020_02_05_123048_create_trabalhos_table.php
View file @
89078619
...
...
@@ -36,6 +36,7 @@ class CreateTrabalhosTable extends Migration
$table
->
unsignedBigInteger
(
'evento_id'
);
$table
->
unsignedBigInteger
(
'coordenador_id'
);
$table
->
unsignedBigInteger
(
'proponente_id'
);
$table
->
softDeletes
();
$table
->
timestamps
();
});
...
...
database/migrations/2020_05_23_054805_create_avaliadors_table.php
View file @
89078619
...
...
@@ -16,6 +16,7 @@ class CreateAvaliadorsTable extends Migration
Schema
::
create
(
'avaliadors'
,
function
(
Blueprint
$table
)
{
$table
->
bigIncrements
(
'id'
);
$table
->
timestamps
();
$table
->
softDeletes
();
$table
->
unsignedBigInteger
(
'user_id'
)
->
nullable
();
$table
->
foreign
(
'user_id'
)
->
references
(
'id'
)
->
on
(
'users'
);
...
...
database/migrations/2020_05_26_223341_create_avaliadors_trabalhos_table.php
View file @
89078619
...
...
@@ -21,6 +21,7 @@ class CreateAvaliadorsTrabalhosTable extends Migration
$table
->
string
(
'AnexoParecer'
)
->
nullable
();
$table
->
boolean
(
'status'
)
->
nullable
();
$table
->
string
(
'recomendacao'
)
->
nullable
();
$table
->
softDeletes
();
$table
->
unsignedBigInteger
(
'trabalho_id'
);
$table
->
unsignedBigInteger
(
'avaliador_id'
);
...
...
resources/views/projeto/index.blade.php
View file @
89078619
...
...
@@ -59,6 +59,12 @@
<
a
href
=
""
class
=
"dropdown-item"
style
=
"text-align: center"
>
Resultado
</
a
>
@
if
(
$projeto
->
status
==
'Submetido'
)
<
a
href
=
"{{ route('trabalho.destroy', ['id' =>
$projeto->id
]) }}"
class
=
"dropdown-item"
style
=
"text-align: center"
>
Excluir
projeto
</
a
>
@
endif
</
div
>
</
div
>
</
td
>
...
...
routes/web.php
View file @
89078619
...
...
@@ -87,12 +87,13 @@ Route::group(['middleware' => ['isTemp', 'auth', 'verified']], function(){
Route
::
post
(
'/areaModalidade/criar'
,
'AreaModalidadeController@store'
)
->
name
(
'areaModalidade.store'
);
//######### Trabalho ########################################
Route
::
get
(
'/trabalho/submeter/{id}'
,
'TrabalhoController@index'
)
->
name
(
'trabalho.index'
);
Route
::
post
(
'/trabalho/novaVersao'
,
'TrabalhoController@novaVersao'
)
->
name
(
'trabalho.novaVersao'
);
Route
::
post
(
'/trabalho/criar'
,
'TrabalhoController@store'
)
->
name
(
'trabalho.store'
);
Route
::
get
(
'/edital/{id}/projetos'
,
'TrabalhoController@projetosDoEdital'
)
->
name
(
'projetos.edital'
);
Route
::
get
(
'/projeto/{id}/editar'
,
'TrabalhoController@edit'
)
->
name
(
'trabalho.editar'
);
Route
::
post
(
'/projeto/{id}/atualizar'
,
'TrabalhoController@update'
)
->
name
(
'trabalho.update'
);
Route
::
get
(
'/trabalho/submeter/{id}'
,
'TrabalhoController@index'
)
->
name
(
'trabalho.index'
);
Route
::
post
(
'/trabalho/novaVersao'
,
'TrabalhoController@novaVersao'
)
->
name
(
'trabalho.novaVersao'
);
Route
::
post
(
'/trabalho/criar'
,
'TrabalhoController@store'
)
->
name
(
'trabalho.store'
);
Route
::
get
(
'/edital/{id}/projetos'
,
'TrabalhoController@projetosDoEdital'
)
->
name
(
'projetos.edital'
);
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'
);
//######### 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