{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/15045","repository_url":"https://api.github.com/repos/laravel/framework","labels_url":"https://api.github.com/repos/laravel/framework/issues/15045/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/15045/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/15045/events","html_url":"https://github.com/laravel/framework/issues/15045","id":173234286,"number":15045,"title":"[5.3.2] Tinker Factory create SQL Statement Error","user":{"login":"AhmedFathieg","id":12021159,"avatar_url":"https://avatars.githubusercontent.com/u/12021159?v=3","gravatar_id":"","url":"https://api.github.com/users/AhmedFathieg","html_url":"https://github.com/AhmedFathieg","followers_url":"https://api.github.com/users/AhmedFathieg/followers","following_url":"https://api.github.com/users/AhmedFathieg/following{/other_user}","gists_url":"https://api.github.com/users/AhmedFathieg/gists{/gist_id}","starred_url":"https://api.github.com/users/AhmedFathieg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AhmedFathieg/subscriptions","organizations_url":"https://api.github.com/users/AhmedFathieg/orgs","repos_url":"https://api.github.com/users/AhmedFathieg/repos","events_url":"https://api.github.com/users/AhmedFathieg/events{/privacy}","received_events_url":"https://api.github.com/users/AhmedFathieg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-25T15:26:15Z","updated_at":"2016-08-25T15:50:20Z","closed_at":null,"body":"## Model\r\n```\r\n\r\nuse Illuminate\\Database\\Eloquent\\Model;\r\nuse Illuminate\\Database\\Eloquent\\SoftDeletes;\r\n\r\nclass Customer extends Model\r\n{\r\n    use SoftDeletes;\r\n    protected $dates = ['deleted_at'];\r\n    protected $fillable = [\r\n        'parent_id',\r\n        'type_id',\r\n        'group_id',\r\n        'name',\r\n        'tax_no',\r\n        'trade_register',\r\n        'fund_date',\r\n        'note',\r\n        'image',\r\n        'status',\r\n        'created_by',\r\n        'updated_by',\r\n        'deleted_by'\r\n    ];\r\n    public function contacts()\r\n    {\r\n        return $this->morphMany('App\\Contact','contactable');\r\n    }\r\n\r\n    public function addresses(){\r\n        return $this->morphMany('App\\Address','addressable');\r\n    }\r\n}\r\n\r\n```\r\n\r\n## Migration\r\n```\r\npublic function up()\r\n    {\r\n        Schema::create('customers', function (Blueprint $table) {\r\n            $table->increments('id');\r\n            $table->integer('parent_id');\r\n            $table->integer('type_id');\r\n            $table->integer('group_id');\r\n            $table->string('name');\r\n            $table->string('tax_no');\r\n            $table->string('trade_register');\r\n            $table->string('fund_date');\r\n            $table->string('note');\r\n            $table->string('image');\r\n            $table->string('status');\r\n            $table->integer('created_by');\r\n            $table->integer('updated_by');\r\n            $table->integer('deleted_by');\r\n            $table->timestamps();\r\n            $table->softDeletes();\r\n        });\r\n    }\r\n```\r\n## Factory\r\n\r\n```\r\n$factory->define(App\\Customer::class, function (Faker\\Generator $faker) {\r\n\r\n    return [\r\n        'parent_id'         => 0,\r\n        'type_id'           => 0 ,\r\n        'group_id'          => 1 ,\r\n        'name'              => $faker->company ,\r\n        'tax_no'            => random_int(10,10),\r\n        'trade_register'    => random_int(8,8),\r\n        'fund_date'         => $faker->date() ,\r\n        'note'              => $faker->paragraphs(3) ,\r\n        'image'             => $faker->imageUrl(),\r\n        'status'            => 1 ,\r\n        'created_by'        => 1 ,\r\n        'updated_by'        => 1 ,\r\n        'deleted_by'        => 1 ,\r\n    ];\r\n});\r\n\r\n\r\n```\r\n## Git Bash\r\n    $ php artisan tinker\r\n    >>>  factory(App\\Customer::class,3)->create();\r\n\r\n## Error \r\n```\r\nIlluminate\\Database\\QueryException with message 'PHP error:  Array to string conversion in C:\\xampp\\htdocs\\application\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Connection.php\r\non line 410 (SQL: insert into `customers` (`parent_id`, `type_id`, `group_id`, `name`, `tax_no`, `trade_register`, `fund_date`, `note`, `image`, `status`, `created_by`, `updated_by`, `deleted\r\n_by`, `updated_at`, `created_at`) values (0, 0, 1, Cole-Macejkovic, 10, 8, 2012-02-03, Aperiam dicta aut et quidem nobis laborum. Sint quod voluptas ad dolor sed culpa beatae. Rerum vero aut\r\nest saepe dolor et. Laudantium dolore ut minus dignissimos consequuntur., http://lorempixel.com/640/480/180771, 1, 1, 1, 2016-08-25 15:12:04, 2016-08-25 15:12:04, ?))'\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/laravel/framework/issues/comments/242437599","html_url":"https://github.com/laravel/framework/issues/15045#issuecomment-242437599","issue_url":"https://api.github.com/repos/laravel/framework/issues/15045","id":242437599,"user":{"login":"GrahamCampbell","id":2829600,"avatar_url":"https://avatars.githubusercontent.com/u/2829600?v=3","gravatar_id":"","url":"https://api.github.com/users/GrahamCampbell","html_url":"https://github.com/GrahamCampbell","followers_url":"https://api.github.com/users/GrahamCampbell/followers","following_url":"https://api.github.com/users/GrahamCampbell/following{/other_user}","gists_url":"https://api.github.com/users/GrahamCampbell/gists{/gist_id}","starred_url":"https://api.github.com/users/GrahamCampbell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GrahamCampbell/subscriptions","organizations_url":"https://api.github.com/users/GrahamCampbell/orgs","repos_url":"https://api.github.com/users/GrahamCampbell/repos","events_url":"https://api.github.com/users/GrahamCampbell/events{/privacy}","received_events_url":"https://api.github.com/users/GrahamCampbell/received_events","type":"User","site_admin":false},"created_at":"2016-08-25T15:50:20Z","updated_at":"2016-08-25T15:50:20Z","body":"Hmmm. Ping @taylorotwell. Looks like this binding still doesn't work."}}
{"actor":{"display_login":"GrahamCampbell"}}