Laravel 4 migrations - class not found

后端 未结 4 2241
渐次进展
渐次进展 2020-12-15 04:15

This question is now solved - I used the below:

And, problem solved thanks to IRC. I was told to run

php composer.phar dump-autoload         


        
相关标签:
4条回答
  • 2020-12-15 04:58

    Update your composer (composer self-update), then run your composer functions.

    0 讨论(0)
  • 2020-12-15 05:03

    Artisan do the same work:

    php artisan dump-autoload
    

    Just a reminder for those who are not familiar with composer.

    0 讨论(0)
  • 2020-12-15 05:07

    I had this error on xubuntu and fixed it with sudo composer dump-autoload

    0 讨论(0)
  • 2020-12-15 05:10

    In Laravel 4 (illuminate) migration class do not require you to set unsigned method. You can try this.

      class CreateBlogsTable extends Migration
    {
    
        /**
         * Run the migrations.
         *
         * @return void
         */
        public function up()
        {
            Schema::create('blogs', function($table)
            {
                $table->increments('id');
                $table->string('title');
                $table->text('description')->nullable();
                $table->integer('user_id');
                $table->timestamps();
            });
        }
    
        /**
         * Reverse the migrations.
         *
         * @return void
         */
        public function down()
        {
            Schema::drop('blogs');
        }
    }
    

    After having the chat with you, I knew two problems, one is that already mentioned above and the other problem is due to the class not been registered into composer autoload. You will have to run manually : php composer.phar dump-autoload

    0 讨论(0)
提交回复
热议问题