php - Missing argument 2 error using db:seed -


i received project colleague , writing in laravel don't have experience in. tutorial able make database , tables plus data when using php artisian db:seed received same error twice telling me missing argument 2 illuminate\databas\eloquent\model:setattribute() , cannot find fault why decided ask here , because quite noob.

ticket table

create table if not exists `ticket` (   `idtickets` int(10) unsigned not null,   `reference` varchar(255) collate utf8_unicode_ci not null,   `subject` varchar(255) collate utf8_unicode_ci not null,   `name` varchar(255) collate utf8_unicode_ci not null,   `mail` varchar(255) collate utf8_unicode_ci not null,   `content` longtext collate utf8_unicode_ci not null ) engine=innodb default charset=utf8 collate=utf8_unicode_ci; 

yes ticket table longer , has primary key, showing table in case.

migration code:

<?php  use illuminate\database\schema\blueprint; use illuminate\database\migrations\migration;  class createticketstable extends migration {      /**      * run migrations.      *      * @return void      */     public function up()     {         schema::create('ticket', function(blueprint $table)         {             $table->increments('id');                         $table->string('reference');                         $table->string('subject');                         $table->string('name');                         $table->string('mail');                         $table->longtext('content');         });     }      /**      * reverse migrations.      *      * @return void      */     public function down()     {         schema::drop('ticket');     }  } 

user data:

<?php  // composer: "fzaninotto/faker": "v1.3.0"db::table('users')->truncate(); use faker\factory faker;  class seedticketstabletableseeder extends seeder {      public function run()     {         db::table('ticket')->truncate();          $tickets = [             [                             `reference`   => 'randomcode1',                             `subject`   => 'test',                             `name`      => 'testor',                             `mail`      => 'testor@mail.nl',                             `content`   => 'lorem ipsum dolor sit amet'              ]         ];          foreach($tickets $ticket){             ticket::create($ticket);         }          foreach(range(1, 10) $index)         {             seedticketstable::create([              ]);         }     }  } 

i added following line databaseseeder.php = $this->call('seedticketstabletableseeder');

am missing code or simple typo? in advance helping. have checked this related question did not seem much.

edit

added ' content still recieved said error.

typo. missing ' on line 'content'.

use faker\factory faker;  class seedticketstabletableseeder extends seeder {      public function run()     {         db::table('ticket')->truncate();          $tickets = [             [                             `reference`   => 'randomcode1',                             `subject`   => 'test',                             `name`      => 'testor',                             `mail`      => 'testor@mail.nl',                             `content`   => 'lorem ipsum dolor sit amet'              ]         ];          foreach($tickets $ticket){             ticket::create($ticket);         }          foreach(range(1, 10) $index)         {             seedticketstable::create([              ]);         }     }  } 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -