title: Getting a Parse error: syntax error, unexpected '$faker' error when seeding
body: <p>I am getting the following error when trying to seed in Laravel 5.4</p>
  
  <pre><code> [Symfony\Component\Debug\Exception\FatalThrowableError]                                            
  Parse error: syntax error, unexpected '$faker' (T_VARIABLE), expecting function (T_FUNCTION) or c  
  onst (T_CONST)
  </code></pre>
  
  <p>Here is the code for the seed file.</p>
  
  <pre><code>&lt;?php
  
  use Illuminate\Database\Seeder;
  use App\Book;
  use Faker\Factory as Faker;
  
  class BookSeeder extends Seeder
  {
  /**
   * Run the database seeds.
   *
   * @return void
   */
   $faker = Faker::create();
  
  public function run()
  {
    foreach (range(1, 30) as $index) {
      Book::create([
        'title'=&gt; $faker-&gt;sentence(5),
        'author'=&gt; $faker-&gt;sentence(7),
        'description'=&gt;$faker-&gt;paragraph(4)
      ]);
    }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I have created the model and done the migration.  I can't seem to find any good tutorials on how to do this with Laravel 5.4 . Any help would be appreciated.</p>