I’m new to Laravel, I’m building a small project with five tables: users, products, category, transactions, and a pivot table category_product. When I try to run the command
Php artisan migrate
I receive an error class “Transaction” not found
here are the tables.
User Table
Reset Password Table
Products Table
Categories Table
Transactions Table
Category_product Table
** The order of Migrations in the Migration Folder**
And here is the full error I received
Advertisement
Answer
laravel get the migration class name from migration file name, to solve this:
1- rename file 2020_11_06_transactions
to 2020_11_06_create_transactions_table
2-composer dumpautoload
3-php artisan optimize:clear