Object of type App\Models\ConformityCheck is not callable

Hi i am looking for some help i keep getting this on the list view the of the Resource and i cant workout why. The create and edit pages work fine.
No description
Solution:
Ok it’s failing trying to create an event. So the problem is your ObservedBy. Your trying telling the model to observer itself with its own class.
Jump to solution
30 Replies
Tally
Tally8mo ago
We need some extra information to solve this... the content of the resource would be a start 🙂
Michael Jones
Michael JonesOP8mo ago
I have attached the resource as i don't know how to put it inline
Michael Jones
Michael JonesOP8mo ago
Here is the model file also
Tally
Tally8mo ago
hmmm and do you have some custom code in the Pages\ListConformityChecks.php file? You already debugged commenting out all the Tables\Columns in the table function, checking if one of those is bugging Resource and Model looking fine to me
Michael Jones
Michael JonesOP8mo ago
No custom code in Pages\ListConformityChecks.php like you say it looks good. thing about it fine on my local version but the live production it is showing this error
Tally
Tally8mo ago
aaah so local no problems
Michael Jones
Michael JonesOP8mo ago
no
Tally
Tally8mo ago
can you run a "composer dump-autoload" on the server maybe some things are a little outdated somewhere
Michael Jones
Michael JonesOP8mo ago
running now
Tally
Tally8mo ago
fingers crossed
Michael Jones
Michael JonesOP8mo ago
no, still showing this error
Tally
Tally8mo ago
hmmm and clearing the laravel caches would be the next step weird problem
Michael Jones
Michael JonesOP8mo ago
I have done everything and still getting the error. I am going to delete the vendor folder and run composer install again
Tally
Tally8mo ago
yeah good one...
Michael Jones
Michael JonesOP8mo ago
no still no luck Delete the whole folder on the sever to pull in back in
Tally
Tally8mo ago
hmmmm must be some files not transfered to the server
awcodes
awcodes8mo ago
Can you share the flare url? I think step one is figuring out what is actually trying to call the model.
Michael Jones
Michael JonesOP8mo ago
i dont have flare
awcodes
awcodes8mo ago
That error screen you showed should have a share link on it.
Michael Jones
Michael JonesOP8mo ago
Flare
Object of type App\Models\ConformityCheck is not callable - The error occurred at https://quality.morgan-motor.com/conformity-checks
Solution
awcodes
awcodes8mo ago
Ok it’s failing trying to create an event. So the problem is your ObservedBy. Your trying telling the model to observer itself with its own class.
Tally
Tally8mo ago
Good catch Adam! I missed that in the Model
Michael Jones
Michael JonesOP8mo ago
aww yes, overlooked that. let me change to the right class and try again
Tally
Tally8mo ago
Should have failed local as well?
Michael Jones
Michael JonesOP8mo ago
yes that did it, Yes telly you are right but did not god now why not
awcodes
awcodes8mo ago
It’s possible on local that something in the code is disabling model events, like in a seeder or test. Hard to say, but normally yeah, I would expect it to fail locally too.
Michael Jones
Michael JonesOP8mo ago
thank you so much for your help on the both of you, you helped so much Lets mark this as solved and keep coding
Tally
Tally8mo ago
🙂 all the creds to Adam for spotting the Observer 🙂 should have started with the flare link 😉
awcodes
awcodes8mo ago
No problem just please mark it as solved so others can benefit from it.
Michael Jones
Michael JonesOP8mo ago
Thank you once again marked as solved
Want results from more Discord servers?
Add your server