Closed shubham1397 closed 4 years ago
@shubham1397 what laravel version you are using?
6
@shubham1397 will you please share the exact laravel version e.g 6.0.1
and which command you have run to generate scaffold, better to have your db schema so we can identify exact problem.
hey sorry, I,m using laravel 5.7.15, whenever I am going to add new data from the admin dashboard, it gives me an error -
BadMethodCallException Call to undefined method App\Models\drink::withoutEvents()
this is my table schema
@shubham1397 i have tested with your laravel version and your DB schema and its working fine. may be you are making some mistake while generating scaffold.
Please verify you are following this steps : https://labs.infyom.com/laravelgenerator/docs/5.7/installation
yeah sure
I suddenly started facing this same issue on all my update() methods that makes use of the repository. This line for instance, causes the above error
$payment = $this->paymentRepository->update($input,$payment->id);
It happens on all models, not just one.
Edit: to fix it (albeit temporarily) I created an empty withoutEvents() function in the model specified in the error.
Eg. I went into Payment.php
and added a function like so:
public function withoutEvents(){
}
getting this error while inserting and updating data from the admin section as well as from API