Search

Programming
Programming

We provide developers and engineers the guides and tutorials they...

Content
Content

Content is king. It's not just about how you're going to write, b...

Events
Events

Looking for an engaging connection with thousands of other people...

Laravel Migrations Issue: When Deleting A Migration File

Laravel Migrations Issue: When Deleting A Migration File

Working with Laravel is amazing it feels magical but sometimes you get stuck in those magics Laravel is doing for you behind the scene.

Introduction

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.

1*Wd7f7luDtQS3XPqPPNi9fA.png

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

1*V6_kAvLAlv_uMmjbaQEyGw.png

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

 
1*KlrTz3wGnEwEy8t7h1xhsg.png

Thanks,

Follow me on Twitter : @azibaloch

Azeem Hassni

About author

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.

View all posts (4)
Your experience on this site will be improved by allowing cookies Cookie Policy