How to check in the API if a user who is being searched in the database is the user that is logged in?

0

I am using Laravel and I need to create an attribute (is_me) in the model to know if the current profile belongs to the user that is logged in;

I was doing as below, but now that I'm using API I can no longer use Auth :: user ()

public function getIsMeAttribute(){
    return \Auth::user()->id == $this->id;
}
    
asked by anonymous 30.05.2017 / 21:27

0 answers