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.