Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

davy_yg's avatar
Level 27

Unable to connect to the laravel framework

Hello,

I try to do this:

framework_freshway\framework.env

DB_HOST=localhost DB_DATABASE=wwwsoulf_revsoul DB_USERNAME=root DB_PASSWORD=

http://localhost/framework_freshway/public_html/

Whoops, looks like something went wrong.

3/3 ErrorException in 1319c52207fd4f3069a97397543698e4 line 1275: Trying to get property of non-object (View: C:\xampp\htdocs\framework_freshway\framework\resources\views\home.blade.php) (View: C:\xampp\htdocs\framework_freshway\framework\resources\views\home.blade.php)

http://localhost/framework_freshway/public_html/index.php

 <?php

  /**
 * Laravel - A PHP Framework For Web Artisans
 *
 * @package  Laravel
 * @author   Taylor Otwell <[email protected]>
 */

 /*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader for
| our application. We just need to utilize it! We'll simply require it
| into the script here so that we don't have to worry about manual
| loading any of our classes later on. It feels nice to relax.
|
*/

require __DIR__.'/../framework/bootstrap/autoload.php';

/*
|--------------------------------------------------------------------------
| Turn On The Lights
|--------------------------------------------------------------------------
|
| We need to illuminate PHP development, so let us turn on the lights.
| This bootstraps the framework and gets it ready for use, then it
| will load up this application so that we can run it and send
| the responses back to the browser and delight our users.
|
*/

$app = require_once __DIR__.'/../framework/bootstrap/app.php';

/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can handle the incoming request
| through the kernel, and send the associated response back to
| the client's browser allowing them to enjoy the creative
| and wonderful application we have prepared for them.
|
*/

$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);

$response = $kernel->handle(
$request = Illuminate\Http\Request::capture()
);

$response->send();

$kernel->terminate($request, $response);
0 likes
10 replies
edoc's avatar
3/3 ErrorException in 1319c52207fd4f3069a97397543698e4 line 1275: Trying to get property of non-object (View: C:\xampp\htdocs\framework_freshway\framework\resources\views\home.blade.php) (View: C:\xampp\htdocs\framework_freshway\framework\resources\views\home.blade.php)

This error might be related to your view. can you check if you are trying to display a column value which does not exist on your home.blade.php file??

davy_yg's avatar
Level 27

home.blade.php

Line 1274 - 1276:

if (type == "twitter") { showProfileInfoTwitter("{{$user->twitter->name}}", "{{$user->twitter->screen_name}}", "{{$user->twitter->profile_image}}", "{{$user->twitter->description}}", 0, 0); }

I don't understand which column value?

edoc's avatar

@davy_yg

Probably some of the users' twitter accounts are null. check your database

davy_yg's avatar
Level 27

This is a little bit strange since I downloaded the database and the file exactly from online:

http://fresway.com/

Online it works perfectly. When I downloaded it offline errors start appearing. I wonder why?

samalapsy's avatar

@davy_yg Check if the $user has any information, then Check for the objects name if they exist

davy_yg's avatar
Level 27

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 . '"/>'; }

davy_yg's avatar
Level 27

I also try to type: localhost/framework_freshway/public/admin

to go to :

 Route::get('/', [
      'as' => 'index', 'uses' => 'HomeController@getHome'
 ]);
 Route::get('/admin', [
      'as' => 'admin', 'uses' => 'HomeController@getAdmin'
 ]);

Yet it carries me to localhost/dashboard

Any clue why?

bunnypro's avatar

@davy_yg just run php artisan serve form your project and access your site from given link.

that is just a middleware that redirect you to /dashboard.

davy_yg's avatar
Level 27

This is what happen so far:

C:\xampp\htdocs\framework_freshway\framework>php artisan serve Laravel development server started on http://localhost:8000/ [Mon Apr 24 12:53:43 2017] PHP Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0 [Mon Apr 24 12:53:43 2017] PHP Fatal error: Unknown: Failed opening required 'C:\xampp\htdocs\framework_freshway\framework/server.php' (include_path='C:\xampp\php\PEAR') in Unknown on line 0 [Mon Apr 24 12:53:43 2017] PHP Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0 [Mon Apr 24 12:53:43 2017] PHP Fatal error: Unknown: Failed opening required 'C:\xampp\htdocs\framework_freshway\framework/server.php' (include_path='C:\xampp\php\PEAR') in Unknown on line 0 [Mon Apr 24 12:53:43 2017] PHP Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0 [Mon Apr 24 12:53:43 2017] PHP Fatal error: Unknown: Failed opening required 'C:\xampp\htdocs\framework_freshway\framework/server.php' (include_path='C:\xampp\php\PEAR') in Unknown on line 0

http://localhost:8000/

Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0

Fatal error: Unknown: Failed opening required 'C:\xampp\htdocs\framework_freshway\framework/server.php' (include_path='C:\xampp\php\PEAR') in Unknown on line 0

Please or to participate in this conversation.