laravel migration primary key when you have start date and end date code example Example: laravel migration with primary key $table->string('code', 30)->primary();