Rohitashv Singhal
Rohitashv Singhal

Reputation: 4557

Masters table not found in database

I have an issue with laravel.

I have created a database named billing and connection is working fine for all tables. Now I created a new table named as masters. When I'm using this table then it is showing error base table or view masters not found

How can I resolve this issue?

Upvotes: 1

Views: 90

Answers (2)

Udhav Sarvaiya
Udhav Sarvaiya

Reputation: 10091

To create a migration, use the make:migration Artisan command:

php artisan make:migration create_masters_table

The new migration will be placed in your database/migrations directory.

You can use Laravel schema builder to expressively create and modify tables.

To run all of your outstanding migrations, execute the migrate Artisan command: php artisan migrate

Upvotes: 0

Elisha Senoo
Elisha Senoo

Reputation: 3594

This is usual for beginners. I have a few hints:

  • You might want to manually check the database, outside of Laravel, to be sure the table has not been add.
  • Sometimes, you might just have misspelt the table name.
  • Did you forget to run the migration? If so, you need to run the migration to add the table to the database. You can simple use php artisan migrate on the command line.
  • If all these don't resolve it, dump you autoload files with composer and rerun your migration. You can use composer dumpautoload and then php artisan migrate:refresh

Upvotes: 1

Related Questions