Table headerAction -> CreateAction error

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'dbname.1' doesn't exist
SELECT count(*) AS aggregate FROM `1` WHERE `name` = DEFAULT Criteria
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'dbname.1' doesn't exist
SELECT count(*) AS aggregate FROM `1` WHERE `name` = DEFAULT Criteria
. Comparing against my other tables and their headeractions, im not sure where im going wrong here.
->headerActions([
Tables\Actions\CreateAction::make()
->label('Add Criteria')
->slideOver()
->form(Criteria::getForm()),
]);
->headerActions([
Tables\Actions\CreateAction::make()
->label('Add Criteria')
->slideOver()
->form(Criteria::getForm()),
]);
13 Replies
Kenneth Sese
Kenneth Sese2y ago
It’s got to be something with your Criteria class, right? What’s in there?
Mark Chaney
Mark ChaneyOP2y ago
nothing special besides manually setting the db table name. The error happens when i try to submit the form. Its a pretty vague error.
awcodes
awcodes2y ago
Why is in looking for a table named ‘1’? I’d start there. Or is that actually the name of the table?
Mark Chaney
Mark ChaneyOP2y ago
@awcodes i have zero idea, its really odd. Though i must have something else going on as the table actions() arent showing either and i dont have a model policy for this table this is a standalone table builder on a livewire component with other tables, so not admin
awcodes
awcodes2y ago
Hmm, just seems odd that it’s looking for a db table named ‘1’ and you said that Criteria is defining a table name. So something is happening there. Not saying it isn’t filament, but that’s what stands out to me.
Mark Chaney
Mark ChaneyOP2y ago
the table loads content fine if i manually create an entry in the db well, except the actions, again, weird. Need to put the kids to sleep, will try again later ok, so the actions as far as row actions on the table was a global policy issue, so corrected that. Unfortunately it didnt change anything with the creation error.
awcodes
awcodes2y ago
What does the criteria model look like, if you can share.
Mark Chaney
Mark ChaneyOP2y ago
@awcodes the question though, is why is it doing a SELECT anyway, why isnt it erroring on an INSERT?
awcodes
awcodes2y ago
Good question. Why is it trying to do a count.?
Mark Chaney
Mark ChaneyOP2y ago
ah, its that unique() placeholder. Simply returning true on it still makes it do a query
awcodes
awcodes2y ago
Weird, but yea. Unique validation has to do a query.
Mark Chaney
Mark ChaneyOP2y ago
oh man, that was driving me nuts. thanks
awcodes
awcodes2y ago
Not sure I helped. But glad you found it.
Want results from more Discord servers?
Add your server