title: Laravel - Don't fire events when seeding database
body: <p>I have a service provider which defines which models to observe in the boot method, e.g:</p>
  
  <pre><code>Task::observe(TaskObserver::class);
  </code></pre>
  
  <p>In <code>TaskObserver.php</code> I am listening for the <code>updated</code> event that fires when the model is updated.</p>
  
  <p>When this happens, the Notification facade send an email to a collection of clients:</p>
  
  <pre><code>Notification::send($clients, new TaskUpdated($task));
  </code></pre>
  
  <p>Everything is working fine, but the problem I have is when I seed my database, I get an error <code>[Symfony\Component\Debug\Exception\FatalThrowableError]
    __clone method called on non-object
  </code></p>
  
  <p>My table seeder makes use of a factory which simply returns the values needed to create a model.</p>
  
  <p>Why is the <code>updated</code> event firing when a Task is being created by the factory? And is there a way of avoiding the error when running the seeder?</p>
  
  <p><strong>Seeder:</strong></p>
  
  <pre><code>class DatabaseSeeder extends Seeder
  {
      public function run()
      {
          ...
          $this-&gt;call(TasksTableSeeder::class);
          ...
      }
  }
  
  class TasksTableSeeder extends Seeder
  {
      public function run()
      {
          factory(Task::class, 50)-&gt;create();
      }
  }
  
  $factory-&gt;define(Task::class, function (Faker $faker) {
      return [
          'title' =&gt; $faker-&gt;sentence,
          'description' =&gt; $faker-&gt;sentence(8),
          'created_at' =&gt; Carbon::now(),
          'updated_at' =&gt; Carbon::now(),
      ];
  });
  </code></pre>