这是怎么回事,这是什么意思?

时间:2019-10-19 11:12:28

标签: laravel-5 eloquent laravel-seeding

  

Symfony\Component\Debug\Exception\FatalThrowableError : Argument 1 passed to Illuminate\Database\Eloquent\Relations\HasOneOrMany::save() must be an instance of Illuminate\Database\Eloquent\Model, instance of Illuminate\Database\Eloquent\Collection given, called in C:\xampp\htdocs\realtimeApp\database\seeds\DatabaseSeeder.php on line 23

  

C:\xampp\htdocs\realtimeApp\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Relations\HasOneOrMany.php:248 244| * 245| * @param \Illuminate\Database\Eloquent\Model $model 246| * @return \Illuminate\Database\Eloquent\Model|false 247| */ 248| public function save(Model $model) 249| { 250| $this->setForeignAttributesForCreate($model); 251| 252| return $model->save() ? $model : false;

异常跟踪:

  

1 Illuminate\Database\Eloquent\Relations\HasOneOrMany::save(Object(Illuminate\Database\Eloquent\Collection)) C:\xampp\htdocs\realtimeApp\database\seeds\DatabaseSeeder.php:23 2 DatabaseSeeder::{closure}(Object(App\Models\Reply)) C:\xampp\htdocs\realtimeApp\vendor\laravel\framework\src\Illuminate\Support\Traits\EnumeratesValues.php:176 Please use the argument -v to see more details.

0 个答案:

没有答案