php - Fatal error - Cannot use object of type stdClass as array (Eloquent) -


error trying row database using eloquent:

fatal error: cannot use object of type stdclass array in...

i'm using wamp. make observation because i've implemented similar codes in remote servers , got no problems.

$row = $database::table('users')->where('email', $email)->first(); 

the issue when i'm trying take $row content:

if($row['first_name']) { // causes fatal error  } 

why?

next, database configuration file:

use illuminate\database\capsule\manager capsule;   $database = new capsule();   $database->addconnection([      'driver'   => 'mysql',      'host'     => 'localhost',      'database' => 'animalfm',      'username' => 'root',      'password' => ''  ]);  $database->setasglobal();  $database->booteloquent(); 


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -