for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use Illuminate\Database\Migrations\Migration;
use \jlourenco\base\Database\Blueprint;
class CreateCustomfieldsTables 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('CustomField', function (Blueprint $table) {
$table->increments('id');
$table->string('title', 25);
$table->string('friendly_name', 150);
$table->string('default_value', 250)->nullable();
$table->string('type', 25);
$table->binary('register');
$table->binary('edit');
$table->binary('mandatory');
$table->text("html");
$table->string('entity', 100);
$table->timestamps();
$table->softDeletes();
$table->creation();
});
Schema::create('CustomValue', function (Blueprint $table) {
$table->integer('customfield')->unsigned();
$table->string('value', 250)->nullable();
$table->morphs("entity");
$table->foreign('customfield')->references('id')->on('CustomField');
}
* Reverse the migrations.
public function down()
Schema::drop('CustomValue');
Schema::drop('CustomField');
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.