for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use jlourenco\base\Database\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateRulesTables 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('Rule', function (Blueprint $table) {
$table->increments('id');
$table->string('title', 100);
$table->text('rule');
$table->binary('status');
$table->timestamps();
$table->softDeletes();
$table->creation();
});
Schema::create('RuleTree', function (Blueprint $table) {
$table->string('title', 100)->nullable();
$table->integer('rule')->unsigned()->nullable();
$table->integer('parent')->unsigned()->nullable();
$table->string('list', 100);
$table->foreign('rule')->references('id')->on('Rule');
$table->foreign('parent')->references('id')->on('RuleTree');
}
* Reverse the migrations.
public function down()
Schema::drop('RuleTree');
Schema::drop('Rule');
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.