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
b21a69af
Commit
b21a69af
authored
May 19, 2022
by
Guilherme Silva
Browse files
Criada parte lógica de area tematica
parent
acb4245a
Changes
3
Show whitespace changes
Inline
Side-by-side
app/Http/Controllers/AreaTematicaController.php
0 → 100644
View file @
b21a69af
<?php
namespace
App\Http\Controllers
;
use
App\AreaTematica
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Http\Request
;
class
AreaTematicaController
extends
Controller
{
public
function
destroy
(
$id
)
{
$areaTematica
=
AreaTematica
::
find
(
$id
);
$areaTematica
->
delete
();
return
redirect
(
route
(
'grandearea.index'
)
)
->
with
([
'mensagem'
=>
'Área Tematica excluida com sucesso'
]);
}
public
function
update
(
Request
$request
,
$id
)
{
$areaTematica
=
AreaTematica
::
find
(
$id
);
$areaTematica
->
nome
=
$request
->
nome
;
$areaTematica
->
update
();
return
redirect
(
route
(
'grandearea.index'
)
)
->
with
([
'mensagem'
=>
'Área Tematica editada com sucesso'
]);
}
public
function
edit
(
$id
)
{
$areaTematica
=
AreaTematica
::
find
(
$id
);
return
view
(
'areaTematica.editar'
)
->
with
([
'areaTematica'
=>
$areaTematica
]);
}
public
function
create
()
{
return
view
(
'areaTematica.create'
);
}
public
function
store
(
Request
$request
)
{
$validatedData
=
$request
->
validate
([
'nome'
=>
'required'
,
]);
$areaTematica
=
new
AreaTematica
();
$areaTematica
->
nome
=
$request
->
nome
;
$areaTematica
->
save
();
return
redirect
(
route
(
'grandearea.index'
)
)
->
with
([
'mensagem'
=>
'Área Tematica cadastrada com sucesso'
]);
}
}
app/Http/Controllers/GrandeAreaController.php
View file @
b21a69af
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
namespace
App\Http\Controllers
;
namespace
App\Http\Controllers
;
use
App\AreaTematica
;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
use
App\GrandeArea
;
use
App\GrandeArea
;
use
App\Area
;
use
App\Area
;
...
@@ -16,7 +17,8 @@ class GrandeAreaController extends Controller
...
@@ -16,7 +17,8 @@ class GrandeAreaController extends Controller
public
function
index
()
public
function
index
()
{
{
$grandesAreas
=
GrandeArea
::
orderBy
(
'nome'
)
->
get
();
$grandesAreas
=
GrandeArea
::
orderBy
(
'nome'
)
->
get
();
return
view
(
'naturezas.grandeArea.index'
)
->
with
([
'grandesAreas'
=>
$grandesAreas
]);
$areasTematicas
=
AreaTematica
::
orderBy
(
'nome'
)
->
get
();
return
view
(
'naturezas.grandeArea.index'
)
->
with
([
'grandesAreas'
=>
$grandesAreas
,
'areasTematicas'
=>
$areasTematicas
]);
}
}
/**
/**
...
...
app/Http/Controllers/TrabalhoController.php
View file @
b21a69af
...
@@ -9,6 +9,7 @@ use Auth;
...
@@ -9,6 +9,7 @@ use Auth;
use
App\Area
;
use
App\Area
;
use
App\User
;
use
App\User
;
use
App\Evento
;
use
App\Evento
;
use
App\AreaTematica
;
use
App\Arquivo
;
use
App\Arquivo
;
use
App\Coautor
;
use
App\Coautor
;
use
App\Revisor
;
use
App\Revisor
;
...
@@ -88,6 +89,7 @@ class TrabalhoController extends Controller
...
@@ -88,6 +89,7 @@ class TrabalhoController extends Controller
{
{
$edital
=
Evento
::
find
(
$id
);
$edital
=
Evento
::
find
(
$id
);
$grandeAreas
=
GrandeArea
::
orderBy
(
'nome'
)
->
get
();
$grandeAreas
=
GrandeArea
::
orderBy
(
'nome'
)
->
get
();
$areaTematicas
=
AreaTematica
::
orderBy
(
'nome'
)
->
get
();
$funcaoParticipantes
=
FuncaoParticipantes
::
orderBy
(
'nome'
)
->
get
();
$funcaoParticipantes
=
FuncaoParticipantes
::
orderBy
(
'nome'
)
->
get
();
$proponente
=
Proponente
::
where
(
'user_id'
,
Auth
::
user
()
->
id
)
->
first
();
$proponente
=
Proponente
::
where
(
'user_id'
,
Auth
::
user
()
->
id
)
->
first
();
...
@@ -108,6 +110,7 @@ class TrabalhoController extends Controller
...
@@ -108,6 +110,7 @@ class TrabalhoController extends Controller
'rascunho'
=>
$rascunho
,
'rascunho'
=>
$rascunho
,
'enum_turno'
=>
Participante
::
ENUM_TURNO
,
'enum_turno'
=>
Participante
::
ENUM_TURNO
,
'estados'
=>
$this
->
estados
,
'estados'
=>
$this
->
estados
,
'areaTematicas'
=>
$areaTematicas
,
]);
]);
}
}
...
@@ -398,6 +401,7 @@ class TrabalhoController extends Controller
...
@@ -398,6 +401,7 @@ class TrabalhoController extends Controller
}
}
$edital
=
Evento
::
find
(
$projeto
->
evento_id
);
$edital
=
Evento
::
find
(
$projeto
->
evento_id
);
$grandeAreas
=
GrandeArea
::
all
();
$grandeAreas
=
GrandeArea
::
all
();
$areaTematicas
=
AreaTematica
::
orderBy
(
'nome'
)
->
get
();
$areas
=
Area
::
all
();
$areas
=
Area
::
all
();
$subareas
=
Subarea
::
all
();
$subareas
=
Subarea
::
all
();
$funcaoParticipantes
=
FuncaoParticipantes
::
all
();
$funcaoParticipantes
=
FuncaoParticipantes
::
all
();
...
@@ -420,6 +424,7 @@ class TrabalhoController extends Controller
...
@@ -420,6 +424,7 @@ class TrabalhoController extends Controller
'arquivos'
=>
$arquivos
,
'arquivos'
=>
$arquivos
,
'enum_turno'
=>
Participante
::
ENUM_TURNO
,
'enum_turno'
=>
Participante
::
ENUM_TURNO
,
'estados'
=>
$this
->
estados
,
'estados'
=>
$this
->
estados
,
'areaTematicas'
=>
$areaTematicas
,
]);
]);
}
}
...
...
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