Is there not any shorter way to debug this error message. I wonder why it works online already but not offline. I do not change any of the codes.
Anyway, this is part of the codes that uses $user
$uri = Request::path();
if ($uri == "home/video") {
$timeline = Timeline::take(8)->orderBy('updated_at', 'desc')->where('user_id', $user['id'])->where('social', 'youtube')->get();
$check = Timeline::where('user_id', $user['id'])->where('social', 'youtube')->get();
for ($i = 0; $i < count($timeline); $i++) {
$video_id[$i] = explode("/", $timeline[$i]->content);
$img_url[$i] = "http://img.youtube.com/vi/" . $video_id[$i][4] . "/default.jpg";
}
} elseif ($uri == "home/articles") {
$timeline = Timeline::take(8)->orderBy('updated_at', 'desc')->where('user_id', $user['id'])->where('social', 'article')->where('status', '1')->get();
$check = Timeline::where('user_id', $user['id'])->where('status', '1')->where('social', 'article')->get();
} elseif ($uri == "home/gallery") {
$timeline = Timeline::take(8)->orderBy('updated_at', 'desc')->where('user_id', $user['id'])->where('social', 'gallery')->get();
$check = Timeline::where('user_id', $user['id'])->where('social', 'gallery')->get();
} else {
$timeline = Timeline::take(8)->orderBy('updated_at', 'desc')->where('user_id', $user['id'])->where('status', '1')->get();
$check = Timeline::get();
for ($i = 0; $i < count($timeline); $i++) {
if ($timeline[$i]->social == "youtube") {
$video_id[$i] = explode("/", $timeline[$i]->content);
$img_url[$i] = "http://img.youtube.com/vi/" . $video_id[$i][4] . "/default.jpg";
}
}
}
$user_setting = \Soulfy\Setting::where('user_id', $ $user['id'])->join('user_theme', 'user_setting.themes_enable', '=', 'user_theme.themes_enable')->first();
if ($user->image_profile == null) {
$image_url = $user->fb_profile_image;
} else {
$image_url = url("") . '/' . $user->image_profile;
}
$fb_image_url = "";
$user_profile = \Soulfy\UserProfile::where('user_id', $user->id)->first();
if ($user_profile) {
$fb_image_url = '<img onclick="showProfileInfo(this)" data-name="' . $user_profile->name . '"' . ' data-first_name="' . $user_profile->first_name . '" data-last_name="' . $user_profile->last_name . '" data-email="' . $user_profile->email . '" data-url="' . $user_profile->url . '" data-about="' . $user_profile->about . '" data-gender="' . $user_profile->gender . '" data-location="' . $ user_profile->location . '" src="' . $user_profile->profile_image . '"/>';
}