You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should at some point consider to replace all (Auth::check() ? Auth::user() : null) with (Auth::user() ?? null).
Having Auth::check(), which sole purpose is to see if Auth:user() is not null, in the same line as checking Auth::user(), is not great. It would be better if we were to replace it by a singular check, which immediately gave the required result as well.
On another note, there is different kind of check, the if(Auth:check() && Auth:user()) variant- we may want to consider looking into a solution for those as well, though that is a different story entirely.
I'd like to open this issue for discussion.
The text was updated successfully, but these errors were encountered:
This is arguably one of those things that can be done whenever, since it's not a breaking change. It's also really not that dire a thing, but would be nice since it makes things a little tidier.
We should at some point consider to replace all
(Auth::check() ? Auth::user() : null)
with(Auth::user() ?? null)
.Having Auth::check(), which sole purpose is to see if Auth:user() is not null, in the same line as checking Auth::user(), is not great. It would be better if we were to replace it by a singular check, which immediately gave the required result as well.
On another note, there is different kind of check, the
if(Auth:check() && Auth:user())
variant- we may want to consider looking into a solution for those as well, though that is a different story entirely.I'd like to open this issue for discussion.
The text was updated successfully, but these errors were encountered: