fork download
  1. <?php
  2. public function run()
  3. {
  4. factory(\App\Article::class, 80)->make(['category_id' => null])
  5. ->each(function ($article) {
  6. $category = \App\Category::inRandomOrder()->first();
  7. $article->category_id = $category->id;
  8. $article->save();
  9. });
  10. }
Runtime error #stdin #stdout #stderr 0.01s 24284KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Parse error:  syntax error, unexpected 'public' (T_PUBLIC), expecting end of file in /home/KcHyrE/prog.php on line 2