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 CreateContactsTables 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('ContactType', function (Blueprint $table) {
$table->increments('id');
$table->string('name', 100);
$table->text('html')->nullable();
$table->string('description', 250);
$table->timestamps();
$table->softDeletes();
$table->creation();
});
Schema::create('Contact', function (Blueprint $table) {
$table->string('contact_reference', 50);
$table->integer('contacttype')->unsigned();
$table->string('contact', 250);
$table->text('permissions');
$table->foreign('contacttype')->references('id')->on('ContactType');
Schema::create('Contact_Entity', function (Blueprint $table) {
$table->integer('contact')->unsigned();
$table->morphs("entity");
$table->foreign('contact')->references('id')->on('Contact');
}
* Reverse the migrations.
public function down()
Schema::drop('Contact');
Schema::drop('ContactType');
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.