M
M
maiskiykot2020-08-01 13:11:14
Laravel
maiskiykot, 2020-08-01 13:11:14

Why is user verification not working?

There is a simple package for administering articles Link . Everything would be fine, but he does not have his own secure admin panel. The author himself proposes such a check

public static function checkUser(?User $user)
    {
        return $user ? $user->id === 1 : false;
    }


However, $user->id turns out to be empty in this case. Tried to call auth ()-> user ()-> id - swears that this type is not a static method. How to beat this check? Thanks for any help!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
maiskiykot, 2020-08-03
@maiskiykot

I had to throw out almost all the procedures for checking the author and check the routes

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question