Commit c08a3941 authored by Gabriel-31415's avatar Gabriel-31415
Browse files

ajuste em perfil de participante

parent 89078619
......@@ -9,7 +9,7 @@ class Participante extends Model
protected $fillable = ['name', 'user_id', 'trabalho_id', 'participante_id'];
public function user(){
return $this->belongsToMany('App\User');
return $this->belongsTo('App\User');
}
public function trabalhos(){
return $this->belongsToMany('App\Trabalho', 'trabalho_participante');
......
......@@ -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');
DB::table('participantes')->insert([
......
......@@ -101,7 +101,7 @@
{{ __('Perfil Proponente') }}
</a>
@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') }}">
<img src="{{asset('img/icons/file-alt-regular-black.svg')}}" alt="">
{{ __('Perfil Participante') }}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment