for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Eloquent\Model;
class CreateForeignKeys extends Migration {
You can fix this by adding a namespace to your class:
namespace YourVendor; class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
public function up()
{
Schema::table('pdrb_harga_dasars', function(Blueprint $table) {
$table->foreign('province_id')->references('id')->on('provinces')
->onDelete('set null')
->onUpdate('restrict');
});
$table->foreign('regency_id')->references('id')->on('regencies')
Schema::table('regencies', function(Blueprint $table) {
}
public function down()
$table->dropForeign('pdrb_harga_dasars_province_id_foreign');
$table->dropForeign('pdrb_harga_dasars_regency_id_foreign');
$table->dropForeign('regencies_province_id_foreign');
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.