Hi,
I have a Controller that needs to process a form and then do some database checks that involve lockForUpdate on the Whatever table.. (I need to do some operations based on the count, so I can't allow concurrent count-select queries from different users)
The Service and the Model interact with the Database (say Service uses DB::raw and Repository/Model use Eloquent eg Whatever::count()
should I just DB::beginTransaction/lockForUpdate at the top of my controller, let the other service/model queries run as usual and then DB::commit at the end of my controller?
thanks J
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community