php - Laravel : Creating default object from empty value When insertion -


i have problem creating default object empty value on line $analyses->result = 1.0; checked in db has these column.

  $analysis = new analysis;   $analysis->psubid = '1';   $analysis->subjectid = '1';   $analyses->result = 1.0;   $analyses->rtd = 2.0;   $analyses->save();   $analysis = analysis::all();   return $analysis; 

you initiating variable $analysis name , using $analyses in of statement. use same name all

$analysis = new analysis;   $analysis->psubid = '1';   $analysis->subjectid = '1';   $analysis->result = 1.0;   $analysis->rtd = 2.0;   $analysis->save();   $analysis = analysis::all();   return $analysis; 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -