0
Good afternoon.
I have in my Controller the method below:
public function lista () {
$mensagens = Auth::user()->mensagens()->get();
$title= "Mensagens";
return view('auth.mensagens.lista',compact('mensagens','title'));
}
It returns a list of messages from the logged-in user. It turns out that in my data modeling, each message has a Boolean status of 0 or 1. How do I only return messages with status 1 ?
It must be something silly, but today I could not see a solution to this.
Grateful
By using Laravel, I believe you should know what the return of
Auth::user()->mensagens()
, correct? If you don’t know, start by researching this.– Woss
Thanks for the help.
– Carlos Farias