title: Is it possible to extend a migration? And if so, is it a good practice?
body: <p>I have two models that are identical in terms of table structure, but I want to keep them separated to take advantage of something like this:</p>
  
  <p><code>FirstModel::all()</code></p>
  
  <p>My goal is to have a parent migration extended by these two models' migrations, even if they're empty, just for the above reason. Moreover, I really can't stand to copy and paste their structure between two migration files.</p>
  
  <p>Here is the parent migration:</p>
  
  <pre><code>use Illuminate\Database\Migrations\Migration;
  
  class CreateParentModelTable extends Migration
  {
       /**
        * Run the migrations.
        *
        * @return void
        */
        public function up()
        {
            Schema::create('parent_model', function (Blueprint $table) {
                $table-&gt;bigIncrements('id');
                $table-&gt;timestamps();
            });
        }
  
        /**
        * Reverse the migrations.
        *
        * @return void
        */
        public function down()
        {
            Schema::dropIfExists('parent_model');
        }
  }
  </code></pre>
  
  <p>Here is the first model migration:</p>
  
  <pre><code>use App\Database\Migrations\CreateParentModelTable;
  
  class CreateFirstModelTable extends CreateParentModelTable
  {
      /**
      * Run the migrations.
      *
      * @return void
      */
      public function up()
      {
          Schema::create('first_model', function (Blueprint $table) {
              //
          });
      }
  
      /**
      * Reverse the migrations.
      *
      * @return void
      */
     public function down()
     {
         Schema::dropIfExists('first_model');
     }
  }
  </code></pre>
  
  <p>The second model migration is identical, of course.
  Now... I know that this code cannot work because there should be something that actually pulls in the parent model migration, since extending its class is not enough, but the very first problem is that I received a strange error:</p>
  
  <pre><code>Class 'Database\Migrations\CreateParentModelTable' not found
  </code></pre>
  
  <p>Why? Beyond that, what about the real question of this post?</p>
  
  <p><strong>EDIT:</strong> The timestamps in front of <em>CreateParentModelTable</em> that Laravel adds automatically cannot be used when importing. That's why I tried that way.</p>
  
  <p><strong>PRACTICAL SOLUTION:</strong> I just created two migrations since I've been convinced they serve two different purposes, even if in the same way.</p>