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
c08a3941
Commit
c08a3941
authored
Jun 10, 2020
by
Gabriel-31415
Browse files
ajuste em perfil de participante
parent
89078619
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/Participante.php
View file @
c08a3941
...
@@ -9,7 +9,7 @@ class Participante extends Model
...
@@ -9,7 +9,7 @@ class Participante extends Model
protected
$fillable
=
[
'name'
,
'user_id'
,
'trabalho_id'
,
'participante_id'
];
protected
$fillable
=
[
'name'
,
'user_id'
,
'trabalho_id'
,
'participante_id'
];
public
function
user
(){
public
function
user
(){
return
$this
->
belongsTo
Many
(
'App\User'
);
return
$this
->
belongsTo
(
'App\User'
);
}
}
public
function
trabalhos
(){
public
function
trabalhos
(){
return
$this
->
belongsToMany
(
'App\Trabalho'
,
'trabalho_participante'
);
return
$this
->
belongsToMany
(
'App\Trabalho'
,
'trabalho_participante'
);
...
...
database/seeds/ParticipanteSeeder.php
View file @
c08a3941
...
@@ -18,6 +18,12 @@ class ParticipanteSeeder extends Seeder
...
@@ -18,6 +18,12 @@ class ParticipanteSeeder extends Seeder
]);
]);
// $participante = App\Participante::find(1);
// $user = App\User::where('name','Participante1')->first();
// $user->participantes()->save($participante);
// $user->save();
$user_id
=
DB
::
table
(
'users'
)
->
where
(
'name'
,
'Participante2'
)
->
pluck
(
'id'
);
$user_id
=
DB
::
table
(
'users'
)
->
where
(
'name'
,
'Participante2'
)
->
pluck
(
'id'
);
DB
::
table
(
'participantes'
)
->
insert
([
DB
::
table
(
'participantes'
)
->
insert
([
...
...
resources/views/layouts/app.blade.php
View file @
c08a3941
...
@@ -101,7 +101,7 @@
...
@@ -101,7 +101,7 @@
{{ __('Perfil Proponente') }}
{{ __('Perfil Proponente') }}
</a>
</a>
@endif
@endif
@if(Auth::user()->participantes
!= null
)
@if(Auth::user()->participantes
->where('user_id', Auth::user()->id)->count() != 0
)
<a
class=
"dropdown-item"
href=
"{{ route('participante.index') }}"
>
<a
class=
"dropdown-item"
href=
"{{ route('participante.index') }}"
>
<img
src=
"{{asset('img/icons/file-alt-regular-black.svg')}}"
alt=
""
>
<img
src=
"{{asset('img/icons/file-alt-regular-black.svg')}}"
alt=
""
>
{{ __('Perfil Participante') }}
{{ __('Perfil Participante') }}
...
...
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