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 CreateLeagueMoviesTable 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('league_movies', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('league_id');
$table->unsignedInteger('movie_id');
$table->unsignedInteger('price')->nullable();
$table->unsignedInteger('latest_earnings_id')->nullable();
$table->timestamps();
$table->foreign('league_id')
->references('id')->on('leagues')
->onUpdate('cascade')->onDelete('cascade');
$table->foreign('movie_id')
->references('id')->on('movies')
$table->foreign('latest_earnings_id')
->references('id')->on('movie_earnings')
->onUpdate('cascade')->onDelete('set null');
});
}
* Reverse the migrations.
public function down() {
Schema::drop('league_movies');
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.