Answers for "array to string conversion laravel 8 "eloquent""

PHP
1

Database//Eloquent//Model.php laravel errror array t- string conversion

if we give table name in laravel model like array:

 protected $table = ['thoughts'];
then it will generate error.

so you should give table name as string like :

protected $table = 'thoughts';
Posted by: Guest on December-31-2021
10

laravel array to string conversion

$history = [];
foreach($array as $value){
   $array = [
       'value' => $value,
       'status_id' => 2
   ];
   array_push($history, $array);
}
Posted by: Guest on September-02-2021

Code answers related to "array to string conversion laravel 8 "eloquent""

Browse Popular Code Answers by Language