Laravel Migrations Issue: When Deleting A Migration File

Last Updated at : June 11, 2017 By - Azeem Hassni | 2193


    Working with Laravel is amazing it feels magical but sometimes you get stuck in those magics Laravel is doing for you behind the scene. one of them is when you create a migration, Laravel automatically adds the migration file to composer’s auto-loader.

    If you decide not to use the migration you just created and you want to delete it. Wait… if you did that you will get an error next time when you run

    $ php artisan migrate

    Here is how the error looks like

    the quick fix to this issue is run the the following command

    composer dump-autoload

    It will remap the classes in you /database directory and will remove all the non-existent files.

    Here is how i did that


    Follow me on Twitter : @azibaloch

    blog user
    Azeem Hassni

    I write code and i love it. I do write blogs on things which I am passionate about. I love to Explore the internet of things and whats new in web technologies. My topic of Interests include WordPress, Laravel & Magento to name a few.

    Related Posts

    As you may know, Composer is a PHP dependency manager that manages the versions of the PHP libraries, tools & frameworks that we utilise in our applications.

    In this article, we'll go through a brief introduction on setting up PSR4 Autoloading using Composer within your project.

    What is composer?
    October 1, 2017 By - Usama Muneer

    If you're a PHP developer and has been coding up for years, you may have noticed that while developing in PHP, you have to re-invent the wheel every single time.

    Manually Installing composer is an advanced technique, however there are several reasons why a developer might prefer this reason instead of using the interactive installation routine.