for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateAssignedRolesTable 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.
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
Schema::create(config('cortex.auth.tables.assigned_roles'), function (Blueprint $table) {
// Columns
$table->integer('role_id')->unsigned();
$table->integer('entity_id')->unsigned();
$table->string('entity_type', 150);
$table->integer('scope')->nullable();
// Indexes
$table->index(['scope']);
$table->index(['role_id']);
$table->index(['entity_id', 'entity_type', 'scope'], 'assigned_roles_entity_index');
$table->foreign('role_id')->references('id')->on(config('cortex.auth.tables.roles'))
->onDelete('cascade')->onUpdate('cascade');
});
}
* Reverse the migrations.
public function down()
Schema::drop(config('cortex.auth.tables.assigned_roles'));
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.