Social Network with PHP: User profiles (14/37)

preview_player
Показать описание

Official site

Twitter
Рекомендации по теме
Комментарии
Автор

Trying to get property of non-object (View: userblock.blade.php)
When click on user profile link, got this error.
If remove from index.blade.php all ok, but without avatar and username

reesolio
Автор

I'm getting "Sorry, the page you are looking for could not be found." aka "NotFoundHttpException" even with right usename(s). Everything was fine up till this point.
Profile Controller
public function getProfile($username)
{
dd($username);
}
Route
Route::get('/user/{$username}', [
'as' => 'profile.index',
]);
Tried re-writing all of that code but nothing, I'm guessing there is a logical error I made, possible in previous parts (but as I said, everything was fine till this). And now I'm stuck. Any ideas?

gogi
Автор

Got the code right but getting NotFoundHttpException in RouteCollection.php line 161

Please help.

CX
Автор

Hey how can i get a function from another model into a user model and then call it in blade without static function.

zstavba
Автор

@ 3:28 i am getting "NotFoundHttpException in RouteCollection.php line 161:" when clicking on the username and avatar. Any ideas anyone?

sodomousprime
Автор

because i have first name and last name
i add $user = User::where('username', $username)->orWhere(DB::raw("CONCAT(first_name, ' ', last_name)"), $username)->first();

stephencabreros