Refactoring a php function at Laravel Model
I have a method at a Model like this: public function questionOwner($id) { if (auth()->user()->id == $id) { return true; }else{ return false; } } Now I wanted to refactor this function so I tried this: public function queOwner($id) { return !! auth()->user()->id == $id; } So if auth()->user()->id was not equals to $id, then… Read More Refactoring a php function at Laravel Model