Support the ongoing development of Laravel.io →
Database Packages

Some migration files come up as missing:

From term after php artisan migrate:refresh --seed

[Symfony\Component\Debug\Exception\FatalErrorException]
  Class 'CreatePermissionUserTable' not found

The file does exists and is called 2015_02_17_152439_create_permission_user_table

inside the file:

<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePermissionUserTable extends Migration {

	public function up()
	{
		Schema::create('permission_user', function (Blueprint $table) {
			$table->increments('id');
			$table->integer('permission_id')->unsigned()->index();
			$table->foreign('permission_id')->references('id')->on('permissions')->onDelete('cascade');
			$table->integer('user_id')->unsigned()->index();
			$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
			$table->timestamps();
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('permission_user');
	}

}

This file is auto generated by kodeine/laravel-acl

At first I thought this was an issue with the auto generated file, but after skipping the refresh and just deleting the tables from the db by hand I realized the issue also came up with other files

We can work around this for now, but we need to fix it somehow, please help!

Last updated 3 years ago.
0

composer.json

... "classmap": [ "database/" ] ...

$ composer dump -o

?

Last updated 10 years ago.
0

awesome, thank you so much!

0

That helped me too with a similar problem with a auto generated file by Xethron/migrations-generator.

The error was:

[Symfony\Component\Debug\Exception\FatalThrowableError] Fatal error: Class 'AddForeignKeysToXTable' not found

And your solution solved my problem.

I let the error here to help people find it if they have the same problem.

0

composer dump-autoload

0

Great answer worked for me too

0

Yes, thank you. composer dump-autoload worked like a charm. Although I did want to ask, if it's possible at all to automate this operation.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

dieg0 dieg0 Joined 30 May 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.