© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•15mo ago•
19 replies
TranceCode

Can't export data using ExportAction with Tenant

I'm trying to export data using Filament Export in my Tenant project, but when I try to export data it ends up giving me this error:
Base table or view not found: 1146 Table 'ffrankenphp.company_user' doesn't exist (Connection: mysql, SQL: select `companies`.*, `company_user`.`user_id` as `pivot_user_id`, `company_user`.`company_id` as `pivot_company_id` from `companies` inner join `company_user` on `companies`.`id` = `company_user`.`company_id` where `company_user`.`user_id` = 1 and `companies`.`deleted_at` is null) {"userId":1,"exception":"[object] (Illuminate\\Database\\QueryException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ffrankenphp.company_user' doesn't exist (Connection: mysql, SQL: select `companies`.*, `company_user`.`user_id` as `pivot_user_id`, `company_user`.`company_id` as `pivot_company_id` from `companies` inner join `company_user` on `companies`.`id` = `company_user`.`company_id` where `company_user`.`user_id` = 1 and `companies`.`deleted_at` is null) at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:825)
[stacktrace]
Base table or view not found: 1146 Table 'ffrankenphp.company_user' doesn't exist (Connection: mysql, SQL: select `companies`.*, `company_user`.`user_id` as `pivot_user_id`, `company_user`.`company_id` as `pivot_company_id` from `companies` inner join `company_user` on `companies`.`id` = `company_user`.`company_id` where `company_user`.`user_id` = 1 and `companies`.`deleted_at` is null) {"userId":1,"exception":"[object] (Illuminate\\Database\\QueryException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ffrankenphp.company_user' doesn't exist (Connection: mysql, SQL: select `companies`.*, `company_user`.`user_id` as `pivot_user_id`, `company_user`.`company_id` as `pivot_company_id` from `companies` inner join `company_user` on `companies`.`id` = `company_user`.`company_id` where `company_user`.`user_id` = 1 and `companies`.`deleted_at` is null) at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:825)
[stacktrace]


The issue is that this relationship is not what I use, the only relationship that exists between these 2 models is that commonarea belongs to companies, but here it tells me that it needs a
company_user
company_user
relationship, I have reviewed a little more and it seems to me that the export migrations when bringing
user_id
user_id
is causing me problems, I made the change to put it as
customer_id
customer_id
since customer is the user who is logged in and from his panel he can download the excel, but even so the problem is not solved... is there any idea that me give to solve this problem?
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

ExportAction export different model
FilamentFFilament / ❓┊help
2y ago
ExportAction with MInIO
FilamentFFilament / ❓┊help
2y ago
ExportAction on Row to export another model with HasMany relationship
FilamentFFilament / ❓┊help
2y ago
Export data
FilamentFFilament / ❓┊help
2y ago