for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCategoriesTable 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('categories', function (Blueprint $table) {
$table->increments('id');
// nested sets fields
$table->unsignedInteger('parent_id')->nullable()->index();
$table->unsignedInteger('lft')->nullable()->index();
$table->unsignedInteger('rgt')->nullable()->index();
$table->unsignedInteger('depth')->nullable();
$table->string('title');
$table->string('alias');
$table->string('note')->nullable();
$table->boolean('published')->default(false)->index();
$table->boolean('authenticated')->default(false)->index();
$table->integer('hits')->default(0);
$table->mediumText('description')->nullable();
$table->text('parameters')->nullable();
$table->unsignedInteger('created_by')->nullable()->index();
$table->unsignedInteger('updated_by')->nullable()->index();
$table->timestamps();
});
}
* Reverse the migrations.
public function down()
Schema::drop('categories');
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.