title: PHP Fatal error in laravel DatabaseSeeder
body: <p>Hi Guys im newly learning laravel so when i setup code to seed my tables in database, i get this error </p>
  
  <pre><code>Seeding: BearAppSeeder
  PHP Fatal error:  Call to undefined method Bear::create() in C:\Users\mrosh\Desktop\WD\garden\database\seeds\Database
  Seeder.php on line 41
  
  
    [Symfony\Component\Debug\Exception\FatalErrorException]
    Call to undefined method Bear::create()
  </code></pre>
  
  <p>Here is my code in DatabaseSeeder.php file, the idea is to create table for 'bears', 'fish', 'trees' and 'picnics' and links bears to picnics "many-to-many" and seed them with some data  </p>
  
  <pre><code>&lt;?php
  
  use Illuminate\Database\Seeder;
  
  class DatabaseSeeder extends Seeder {
  
      /**
       * Run the database seeds.
       *
       * @return void
       */
      public function run()
      {
          Eloquent::unguard();
  
          // call our class and run our seeds
          $this-&gt;call('BearAppSeeder');
          $this-&gt;command-&gt;info('Bear app seeds finished.'); // show information in the command line after everything is run
      }
  
  }
  
  // our own seeder class
  // usually this would be its own file
  class BearAppSeeder extends Seeder {
  
      public function run() {
  
          // clear our database ------------------------------------------
          DB::table('bears')-&gt;delete();
          DB::table('fish')-&gt;delete();
          DB::table('picnics')-&gt;delete();
          DB::table('trees')-&gt;delete();
          DB::table('bears_picnics')-&gt;delete();
  
          // seed our bears table -----------------------
          // we'll create three different bears
  
          // bear 1 is named Lawly. She is extremely dangerous. Especially when hungry.
          $bearLawly = Bear::create(array(
              'name'         =&gt; 'Lawly',
              'type'         =&gt; 'Grizzly',
              'danger_level' =&gt; 8
          ));
  
          // bear 2 is named Cerms. He has a loud growl but is pretty much harmless.
          $bearCerms = Bear::create(array(
              'name'         =&gt; 'Cerms',
              'type'         =&gt; 'Black',
              'danger_level' =&gt; 4
          ));
  
          // bear 3 is named Adobot. He is a polar bear. He drinks vodka.
          $bearAdobot = Bear::create(array(
              'name'         =&gt; 'Adobot',
              'type'         =&gt; 'Polar',
              'danger_level' =&gt; 3
          ));
  
          $this-&gt;command-&gt;info('The bears are alive!');
  
          // seed our fish table ------------------------
          // our fish wont have names... because theyre going to be eaten
  
          // we will use the variables we used to create the bears to get their id
  
          Fish::create(array(
              'weight'  =&gt; 5,
              'bear_id' =&gt; $bearLawly-&gt;id
          ));
          Fish::create(array(
              'weight'  =&gt; 12,
              'bear_id' =&gt; $bearCerms-&gt;id
          ));
          Fish::create(array(
              'weight'  =&gt; 4,
              'bear_id' =&gt; $bearAdobot-&gt;id
          ));
  
          $this-&gt;command-&gt;info('They are eating fish!');
  
          // seed our trees table ---------------------
          Tree::create(array(
              'type'    =&gt; 'Redwood',
              'age'     =&gt; 500,
              'bear_id' =&gt; $bearLawly-&gt;id
          ));
          Tree::create(array(
              'type'    =&gt; 'Oak',
              'age'     =&gt; 400,
              'bear_id' =&gt; $bearLawly-&gt;id
          ));
  
          $this-&gt;command-&gt;info('Climb bears! Be free!');
  
          // seed our picnics table ---------------------
  
          // we will create one picnic and apply all bears to this one picnic
          $picnicYellowstone = Picnic::create(array(
              'name'        =&gt; 'Yellowstone',
              'taste_level' =&gt; 6
          ));
          $picnicGrandCanyon = Picnic::create(array(
              'name'        =&gt; 'Grand Canyon',
              'taste_level' =&gt; 5
          ));
  
          // link our bears to picnics ---------------------
          // for our purposes we'll just add all bears to both picnics for our many to many relationship
          $bearLawly-&gt;picnics()-&gt;attach($picnicYellowstone-&gt;id);
          $bearLawly-&gt;picnics()-&gt;attach($picnicGrandCanyon-&gt;id);
  
          $bearCerms-&gt;picnics()-&gt;attach($picnicYellowstone-&gt;id);
          $bearCerms-&gt;picnics()-&gt;attach($picnicGrandCanyon-&gt;id);
  
          $bearAdobot-&gt;picnics()-&gt;attach($picnicYellowstone-&gt;id);
          $bearAdobot-&gt;picnics()-&gt;attach($picnicGrandCanyon-&gt;id);
  
          $this-&gt;command-&gt;info('They are terrorizing picnics!');
  
      }
  
  }
  </code></pre>
  
  <p>so how i can fix this i have tried many things but all fails </p>