laravel base table or view not found hasmany

// Laravel can't determine the plural form of the word you used for your table name.

// Just specify your table in the model as such:

class Cotizacion extends Model{
    public $table = "your table name";

0
0
Awgiedawgie 440220 points

                                    It seems Laravel is trying to use category_posts table (because of many-to-many relationship). But you don't have this table, because you've created category_post table. Change name of the table to category_posts.

0
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'rsan.visitors' doesn't exist (SQL: select * from `visitors`) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'pizzahouse.pizzas' doesn't exist (SQL: select * from `pizzas`) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'obox_dash.verifications' doesn't exist SQLSTATE[42S02]: Base table or view not found: 1146 Table 'onetoone.product_models' doesn't exist (SQL: insert into `product_models` (`updated_at`, `created_at`) values (2021-08-04 14:46:02, 2021-08-04 14:46:02)) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'blog.tags' doesn't exist (SQL: select * from `tags`) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'khula_sikshya.menus' doesn't exist (SQL: select * from `menus` where `name` = top_menu limit 1) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'afroshop.offers' doesn't exist (SQL: select * from `offers`) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'laravellte.students' doesn't exist (SQL: select * from `students`) docksal SQLSTATE[42S02]: Base table or view not found SQLSTATE[42S02]: Base table or view not found: 1146 Table 'chat.lh_userdep' doesn't exist SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nvs_tech.users' doesn't exist (SQL: select * from `users` where (`email` = [email protected]) limit 1) PDOException::(SQLSTATE[42S02]: Base table or view not found: 1146 Table visuecst_visuec_stock_live_db.orders doesnt exist) PDOException::("SQLSTATE[42S02]: Base table or view not found: 1146 Table 'visuecst_visuec_stock_live_db.orders' doesn't exist") SQLSTATE[42S02]: Base table or view not found: 1146 Table '.plugin' doesn't exist SQLSTATE[42S02]: Base table or view not found: 1051 Unknown table 'insurance.invoice' SQLSTATE[42S02]: Base table or view not found: 1146 Table 'laravel.faqs' doesn't exist (SQL: select * from `faqs` where `in_home` LIKE Y) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'relationship PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table In Connection.php line 671: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'webomlyn_a1cake. channels' doesn't exist SQLSTATE[42S02]: Base table or view not found: 1146 Table 'exo2_model.stores' doesn't exist (SQL: select * from `stores`) sqlstate 42s02 base table or view not found 1146 table doesn't exist laravel SQLSTATE[42S02]: Base table or view not found: 1146 Table 'linkers.webhook_calls' doesn't exist at SQLSTATE[42S02]: Base table or view not found: 1146 Table ' ' doesn't exist (SQL: alter table SQLSTATE[42S02]: Base table or view not found: 1146 Table migrate not working laravel SQLSTATE[42S02]: Base table or view not found: 1146 Table magento SQLSTATE[42S02]: Base table or view not found: 1146 Table 'blog.users' doesn't exist "message": "SQLSTATE[42S02]: Base table or view not found: 1146 Table sessions doesn't exist SQLSTATE[42S02]: Base table or view not found: 1146 Table 'sofra.settings' doesn't exist (SQL: select * from `settings` limit 1) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'aamezcourier.categories' doesn't exist (SQL: insert into `categories` RROR: SQLSTATE[42S02]: Base table or view not found: 1146 Table SQLSTATE[42S02]: Base table or view not found: 1932 why SQLSTATE[42S02]: Base table or view not found: 1146 Table in live website SQLSTATE[42S02]: Base table or view not found: 1146 Table in live website sqlstate 42s02 base table or view not found 1146 table doesn't exist SQLSTATE[42S02]: Base table or view not found: 1146 Table 'storakmart.sessions' doesn't exist (SQL: select * from `sessions` where `id` = uIVvFjtWNuq5iRp8qUCuf6RWjU74y4rVezQA8LGe limit 1) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'storakmart.sessions' doesn't exist (SQL: select * from `sessions` where `id` = LOtwFYweFBTiTcE8rJ8r9O72yOxGjUxbNFIHoX9e limit 1) SQLSTATE[42S02]: Base table or view not found: 1146 Tablec in live websiste sqlstate 42s02 base table or view not found SQLSTATE[42S02]: Base table or view not found: 1146 Table 'simsim.users' doesn't exist (SQL: select * from `users` where `email` = "SQLSTATE[42S02]: Base table or view not found: 1146 Table 'supersms.laravel_blocker' SQLSTATE[42S02]: Base table or view not found: 1146 Table 'projetopap.users' doesn't exist (SQL: select * from `users`) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ayakahuite.config' doesn't exist (SQL: select * from `config` limit 1) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'dbstore.order_items' doesn't exist SQLSTATE[42S02]: Base table or view not found: 1146 Table 'tanaya_laravel_projects.employees' doesn't exist (SQL: select * from `employees`) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'tanaya_laravel_projects.employee_models' doesn't exist (SQL: select * from `employee_models`) SQLSTATE[42S02]: Base table or view not found: 1146 Table and table exist SQLSTATE[42S02]: Base table or view not found: 1146 Table .global_exception_logs doesn't exist SQLSTATE[42S02]: Base table or view not found: 1146 Table 'schakels.lids' doesn't exist SQLSTATE[42S02]: Base table or view not found: 1146 Table 'matica.shopping_carts' doesn't exist (SQL: insert into `shopping_carts` (`status`, `updated_at`, `created_at`) values (incompleted, 2021-05-31 20:33:04, 2021-05-31 20:33:04)) SQLSTATE[42S02]: Base table or view not found: 1146 Table laravel LSTATE[42S02]: Base table or view not found SQLSTATE[42S02]: Base table or view not found: 1146 Table 'secondlook.categories' doesn't exist (SQL: select * from `categories`) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'users' doesn't exist (SQL: select * from `users` where `id` = 1 limit 1) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'wwtco_lab.users' doesn't exist (SQL: select * from `users` where `email` = [email protected] limit 1) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db_food.user_models' doesn't exist (SQL: select * from `user_models` where `email` = [email protected] and `password` = 12345678 limit 1) SQLSTATE[42S02]: Base table or view not found: 1932 Table 'linnhr.department' doesn't exist in engine (SQL: select * from `department`) SQLSTATE[42S02]: Base table or view not found: 1051 Unknown table migrations SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ecom.users' doesn't SQLSTATE[42S02]: Base table or view not found: 1146 Table 'jobsdb.job_location' doesn't exist laravel SQLSTATE[42S02]: Base table or view not found: 1146 Table 'horde.horde_prefs' doesn't exist Original error was SQLSTATE[42S02]: Base table or view not found: 1146 Table matomo.matomo_option doesnt exist. SQLSTATE[42S02]: Base table or view not found: 1146 Table 'x.migrations' doesn't exist SQLSTATE[42S02]: Base table or view not found: 1146 Table 'lawyer.migrations' doesn't exist SQLSTATE[42S02]: Base table or view not found: 1146 Table 'hotels.hotels' doesn't exist (SQL: select * from `hotels` order by `created_at` desc) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'cargo_db.system_settings' doesn't exist SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db_rara_ads_web.sessions' doesn't exist (SQL: select * from `sessions` where `id` = 5VLSUPm1Pg3UmCw3tVx7DJiHwOY2buX43127BIVW limit 1) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db_rara_ads_web.sessions' doesn't "SQLSTATE[42S02]: Base table or view not found: 1146 laravel SQLSTATE[42S02]: Base table or view not found: 1146 Table SQLSTATE[42S02]: Base table or view not found: 1146 TableSQLSTATE[42S02]: Base table or view not found: 1146 Table SQLSTATE[42S02]: Base table or view not found: 1146 Table 'froxlor.panel_settings' doesn't exist how fixed SQLSTATE[42S02]: Base table or view not found: 1146 Table SQLSTATE[42S02]: Base table or view not found: 1146 site:stackoverflow.com SQLSTATE[42S02]: Base table or view not found: 1051 Unknown table SQLSTATE[42S02]: Base table or view not found: 1146 Table 'insurancebroker.companies' doesn't exist SQLSTATE[42S02]: Base table or view not found: 1932 Table 'samson.site_details' doesn't exist in engine SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ticketer.statuses' doesn't exist (SQL: select * from `statuses`) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bbq.key_value' doesn't exist laravel base table or view not found SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ticketeer.statuses' doesn't exist (SQL: SQLSTATE[42S02]: Base table or view not found: 1146 Table doesn't exist (SQL: alter table `orders` add index `orders_id_index`(`id`)) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'services_db.steud_expu_servs' doesn't exist (SQL: select * from `steud_expu_servs`) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'shipboard.teams_id' doesn't exist SQLSTATE[42S02]: Base table or view not found: 1146 Table 'library-master.categories' doesn't exist SQLSTATE[42S02]: Base table or view not found: 1146 Table 'e-learning.users' doesn't exist fix SQLSTATE[42S02]: Base table or view not found: 1146 Table 'laravel4.dbms' doesn't exist (42S02) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'laravelblog.posts' doesn't exist (SQL: select * from `posts`) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'laravel.visitor' doesn't exist SQLSTATE[42S02]: Base table or view not found: 1146 Table session "message": "SQLSTATE[42S02]: Base table or view not found: 1146 Table api "message": "SQLSTATE[42S02]: Base table or view not found: 1146 Table SQLSTATE[42S02]: Base table or view not found: 1146 Table 'swiftdex3.locales' doesn't exist (SQL: select `locale` from `locales` order by `is_active` desc) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'authors.names' doesn't exist (SQL: select * from `names`) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'dixandc5mcxxf3o6.user' doesn't exist laravel SQLSTATE[42S02]: Base table or view not found: 1146 Table 'blog.blogs' doesn't SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db_enrollment.students' doesn't exist (SQL: select * from `students`) SQLSTATE[42S02]: Base table or view not found: magento 2 "SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db_christian_blue.featureds' doesn't exist (SQL: select * from `featureds`)" SQLSTATE[42S02]: Base table or view not found: 1146 Table '.users' doesn't exist (SQL: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'richlife.sponsor_user' SQLSTATE[42S02]: Base table or view not found: 1146 Table 'softbtxp_eclass.languages' doesn't exist (SQL: select * from `languages` where `def` = 1 limit 1) SQLSTATE[42S02]: Base table or view not found: 1146 Table '' doesn't exist SQLSTATE[42S02]: Base table or view not found: 1146 Table laravel 5.2 SQLSTATE[42S02]: Base table or view not found: 1146 Table 'livelycartDB.settings' doesn't exist (SQL: select * from `settings`) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'asterisk.digium phones _general' doesn't exist:: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'asterisk.digium_phones_general' doesn't exist:: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'asterisk.digium_phones_general' doesn't exist::" 2 PDOException::(SQLSTATE[42S02]: Base table or view not found: 1146 Table table doesnt exist) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db_products.categories' doesn't exist (SQL: select * from `categories`) PDOException: SQLSTATE[42S02]: Base table or view not found: 1932 Table SQLSTATE[42S02]: Base table or view not found: ' lumen SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bitbroker.products' doesn't exist (SQL: select * from `products`) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'zegashop_store_83_1615464839.globals' doesn't exist (SQL: select * from `globals` where `globals`.`id` = 77 limit 1 SQLSTATE[42S02]: Base table or view not found: 1146 Table 'spondon_demo.users' doesn't exist SQLSTATE[42S02]: Base table or view not found: 1146 belongtomany sqlstate[42s02]: base table or view not found: 1146 table doesn't exist SQLSTATE[42S02]: Base table or view not found: 1146 Table 'school.news' doesn't exist (SQL: select * from `news`) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'smartcash.product_product_info' doesn't SQLSTATE[42S02]: Base table or view not found: 1146 Table sessions SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bagisto.bagcategories' doesn't exist SQLSTATE[42S02]: Base table or view not found: 1051 Unknown table 'raaweb.category_gallery' SQLSTATE[42S02]: Base table or view not found: 1146 Table 'raaweb.gallery_categories_runda_gallery' doesn't exist SQLSTATE[42S02]: Base table or view not found: 1146 Table 'My_database_Name.posts' doesn't exist SQLSTATE[42S02]: Base table or view not found: 1146 Table 'begisto.block_users' doesn't exist (SQL: select * from `block_users` where `block_users`.`id` is null limit 1 SQLSTATE[42S02]: Base table or view not found: 1146 Table 'lottery.sessions' doesn't exist SQLSTATE[42S02]: Base table or view not found: 1146 Table php artisan SQLSTATE[42S02]: Base table or view not found: 1146 Table 'talkiyon_db.users' doesn't exist SQLSTATE[42S02]: Base table or view not found: 1146 Table 'slimsakasia8.rfid_tables' doesn't exist (SQL: select * from `rfid_tables`) SQLSTATE[42S02]: Base table or view not found: 1146 Table 'test.defined_data' doesn't exist SQLSTATE[42S02]: Base table or view not found: 1146 Table 'myexpenses.menulist' doesn't exist (SQL: select * from `menulist`) SQLSTATE[42S02]: Base table or view not found 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'threeg.customers' SQLSTATE[42S02]: Base table or view not found: 1146 Table 'pos3.5.system' doesn't exist (42S02 SQLSTATE[42S02]: Base table or view not found: 1146 Table 'multiple.products' doesn't exist for testing : Caused by PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'laravel_6_testing.post' doesn't exist SQLSTATE[42S02]: Base table or view not found: 1146 Table 'panel.users' doesn't exist SQLSTATE[42S02]: Base table or view not found: 1146 Table 'laravel.mailboxes' doesn't exist PDOException::("SQLSTATE[42S02]: Base table or view not found: 1146 Table 'laravel.mailboxes' doesn't exist") SQLSTATE[42S02]: Base table or view not found: 1146 Table 'jobs' doesn't exist Base table or view not found: 1146 Table 'showbox_slimscent.pendings' QLSTATE[42S02]: Base table or view not found: 1146 table or view not found SQLSTATE[42S02]: Base table or view not found: 1146 Table 'blog.settings' SQLSTATE[42S02]: Base table or view not found: 1146 Table 'blog.settings' doesn't exist SQLSTATE[42S02]: Base table or view not found: 1146 Table 'balanceappgccdem_balance.Preferences_descriptions' doesn't exist laravel base table or view not found hasmany Base table or view not found: 1146 Table 'blog_portfolio.cache' doesn't exist "SQLSTATE[42S02]: Base table or view not found: 1146 Table base table or view not found laravel Base table or view not found: 1146 Table 'jobs' doesn't exist Base table or view not found: 1146 Table 'waste_mgmt.oauth_personal_access_clients' doesn't exist laravel SQLSTATE[42S02]: Base table or view not found: SQLSTATE[42S02]: Base table or view not found: 1146 Table laravel SQLSTATE[42S02]: Base table or view not found: 1146 SQLSTATE[42S02]: Base table or view not found: 1146 Table 'laravel.users' doesn't exist SQLSTATE[42S02] lumen Base table or view not found: 1146 Table doesn't exist Base table or view not found: laravel SQLSTATE[42S02]: Base table or view not found: 1146 La table Base table or view not found: 1146 sqlstate 42s02 base table or view not found 1146 table Illuminate\Database\QueryException SQLSTATE[42S02]: Base table or view not found "SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ntec_db.general_settings' doesn't exist" "SQLSTATE[42S02]: Base table or view not found: Base table or view not found: 1146 Table 'voter information.worker info' doesn't exist Base table or view not found PDOException::("SQLSTATE[42S02]: Base table or view not found: 1146 Table 'laravel.comments' doesn't exist") laravel 8 Base table or view not found: 1146 Table 'audits' doesn't exist laravel 8 Base table or view not found: 1146 Table 'alifshop_db.audits' doesn't exist SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bushenge_web2.donation' doesn't exist Base table or view not found: 1146 Table users doesn't Stripe Base table or view not found: 1146 Table Illuminate/Database/QueryException with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table SQLSTATE[42S02]: Base table or view not found: 1146 Table 'PMS.user has permissions' doesn't exist in laravel Base table or view not found: 1146 Table 'PMS.user has permissions' doesn't exist (SQL: insert into `user_has_permissions` SQLSTATE[42S02]: Base table or view not found: 1146 Table 'tests.users' doesn't exist SQLSTATE[42S02]: Base table or view not found: 1146 Table Illuminate/Database/QueryException with message 'SQLSTATE[42S02]: Base table or view not found: QLSTATE[42S02]: Base table or view not found: SQLSTATE[42S02]: Base table or view not found: SQLSTATE[42S02]: Base table or view not found: 1146 Tabl
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source