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
b0088c54
Commit
b0088c54
authored
Nov 05, 2022
by
unknown
Browse files
Forma do avaliador ter uma categoria baseada nas naturezas
parent
e03d1062
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/UserController.php
View file @
b0088c54
...
@@ -14,6 +14,7 @@ use App\Endereco;
...
@@ -14,6 +14,7 @@ use App\Endereco;
use
App\Trabalho
;
use
App\Trabalho
;
use
App\Coautor
;
use
App\Coautor
;
use
App\Evento
;
use
App\Evento
;
use
App\Natureza
;
use
Carbon\Carbon
;
use
Carbon\Carbon
;
use
Illuminate\Validation\Rule
;
use
Illuminate\Validation\Rule
;
use
Illuminate\Support\Facades\Hash
;
use
Illuminate\Support\Facades\Hash
;
...
@@ -106,6 +107,8 @@ class UserController extends Controller
...
@@ -106,6 +107,8 @@ class UserController extends Controller
$avaliador
=
Avaliador
::
where
(
'user_id'
,
'='
,
$id
)
->
first
();
$avaliador
=
Avaliador
::
where
(
'user_id'
,
'='
,
$id
)
->
first
();
$avaliador
->
user_id
=
$user
->
id
;
$avaliador
->
user_id
=
$user
->
id
;
//$avaliador->area_id = $request->area;
//$avaliador->area_id = $request->area;
$avaliador
->
naturezas
()
->
sync
(
$request
->
natureza
);
$avaliador
->
update
();
$avaliador
->
update
();
}
}
...
@@ -206,11 +209,13 @@ class UserController extends Controller
...
@@ -206,11 +209,13 @@ class UserController extends Controller
$avaliador
=
Avaliador
::
where
(
'user_id'
,
'='
,
$id
)
->
first
();
$avaliador
=
Avaliador
::
where
(
'user_id'
,
'='
,
$id
)
->
first
();
$proponente
=
Proponente
::
where
(
'user_id'
,
'='
,
$id
)
->
first
();
$proponente
=
Proponente
::
where
(
'user_id'
,
'='
,
$id
)
->
first
();
$participante
=
Participante
::
where
(
'user_id'
,
'='
,
$id
)
->
first
();
$participante
=
Participante
::
where
(
'user_id'
,
'='
,
$id
)
->
first
();
$naturezas
=
Natureza
::
orderBy
(
'nome'
)
->
get
();
return
view
(
'user.perfilUser'
)
->
with
([
'user'
=>
$user
,
return
view
(
'user.perfilUser'
)
->
with
([
'user'
=>
$user
,
'adminResp'
=>
$adminResp
,
'adminResp'
=>
$adminResp
,
'avaliador'
=>
$avaliador
,
'avaliador'
=>
$avaliador
,
'proponente'
=>
$proponente
,
'proponente'
=>
$proponente
,
'participante'
=>
$participante
]);
'participante'
=>
$participante
,
'naturezas'
=>
$naturezas
]);
}
}
}
}
resources/views/user/perfilUser.blade.php
View file @
b0088c54
...
@@ -134,6 +134,17 @@
...
@@ -134,6 +134,17 @@
</
span
>
</
span
>
@
enderror
@
enderror
</
div
>
</
div
>
<
div
class
=
"col-md-6"
>
<
label
for
=
"area"
class
=
"col-form-label"
>
{{
__
(
'Natureza:'
)
}}
</
label
>
<
br
>
@
foreach
(
$naturezas
as
$natureza
)
<
input
type
=
"checkbox"
name
=
"natureza[]"
id
=
"natureza
{
{$natureza->id}
}
"
value
=
"
{
{$natureza->id}
}
"
@
if
((
empty
(
old
(
'natureza'
))
&&
$avaliador
->
naturezas
->
contains
(
$natureza
->
id
))
||
(
!
empty
(
old
(
'natureza'
))
&&
in_array
(
$natureza
->
id
,
old
(
'natureza'
))))
checked
@
endif
>
<
label
class
=
"form-check-label"
for
=
"natureza
{
{$natureza->id}
}
"
>
{{
$natureza
->
nome
}}
</
label
>
@
endforeach
</
div
>
@
else
@
else
<
div
class
=
"col-md-6"
>
<
div
class
=
"col-md-6"
>
<
div
class
=
"form-group"
>
<
div
class
=
"form-group"
>
...
...
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