A
A
annonimus2019-06-09 00:17:50
Laravel
annonimus, 2019-06-09 00:17:50

Error in Laravel ( Whoops, looks like something went wrong.), how to fix it?

Good day to all!
Guys, for some reason, one of the users stopped opening the page after patching phpmyadmin. Error . How to fix it?
Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Konstantin B., 2019-06-09
@Kostik_1993

Most likely, the error is somewhere here, since the follower is simply absent, and therefore its attributes cannot be obtained.
To prevent such errors, you need to use the optional () helper function.
But it is better to think over the architecture in such a way as to check for the presence of a follower and display / not display information about it
More you can use such a short construction of PHP itself
$follower->follower->username_slug ?? 'undefined';

V
Vitaliy Orlov, 2019-06-09
@orlov0562

In the error you wrote
In Russian, this means that on line 124 of the userapp.blade.php file, you are calling a field that does not exist in the object. Here is a simpler example that will have the same error

<?php
$obj = null;
$obj->a;

Go to the specified line and figure out why you have an empty object there or not an object at all. Or do something like
<?php
$obj = null;
if (is_object($obj) && property_exists($obj, 'a')) {
    $obj->a;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question