You question is slightly confusing as I don't know what the other table is outside User. You first need to figure out the type of relationship between user table and the other.
Check documentation for an example - https://laravel.com/docs/5.2/eloquent-relationships#defining-relationships
Thanks.
I tryed
public function GetUser(){ return $this->belongsTo(Usuario::class, 'id_usuarios', 'fk_usuarios'); }
and into view have this code:
@if (count($user->GetUser) > 0) @foreach($user->GetUser AS $us) de [ {{ $us->nombre_usuarios }} ] @endforeach @endif
What I do wrong?
The error: Trying to get property of non-object (View: F:\Fnt\Web\Economato\Fuentes\resources\views\welcome.blade.php)
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community