title: Eloquent Seeder - only add if data doesn't exist
body: <p>I have a table called <code>permissions</code>; this is like the different roles a user can have. As the project grows, I may add more functionalities, therefore more <code>permissions</code> are created. </p>
  
  <p>I have a <code>PermissionSeeder.php</code> that I would like to keep on adding the permissions that I add. Then every time a new permission is added, I would like to run the seeder on it. But, the existing entries should not be created.</p>
  
  <p>I was thinking of truncating the table on every update, but then <code>permission_id</code> on the other pivot tables will conflict since they are the foreign keys. </p>
  
  <p>This is what I was going to do at the moment:</p>
  
  <pre><code>use Permission;
  class PermissionSeeder extends Seeder {
  
      public function run()
      {
          $permissions = [...]; // this is the array of ALL permissions that will keep on growing
  
          foreach ($permissions as $permission) {
              $model = Permission::whereName($permission['name']);
              if ($model-&gt;count() &lt;= 0) {
                  DB::table('permissions')-&gt;insert($permission);
              }
          }
      }
  }
  </code></pre>
  
  <p>Is there a better practice?</p>