Replies: 2 comments 1 reply
-
Looking at the code you should be able to do the following: return $this->belongsToMany(Extra::class, InquiryExtra::class); |
Beta Was this translation helpful? Give feedback.
1 reply
-
Do we have any other solution to handle casting on the pivot model? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Laravel Version
10.20.0
PHP Version
8.2.6
Database Driver & Version
8.0.31
Description
I am trying to use a custom pivot table to define a cast. The custom pivot table uses the default laravel naming conventions for the database table while making a query.
Actual Result:
The database error i got:
Even if i specifically define the
protected $table = 'inquiry_extras';
on the InquiryExtra table it doesn't respect that.Expected Result:
It should be using the table name "inquiry_extras" (as thats what we expect to get from InquieryExtra model) so the database donot throw the table not found error.
Beta Was this translation helpful? Give feedback.
All reactions