skip to Main Content

Laravel DB::transaction()

I have some code and tried it in two ways. It's not working as expected and is not rolling back data Error produce example is in git : https://github.com/Namvarii/laravel-db-transaction-error DB::beginTransaction(); try { $order = Order::create([ // data ]); $order->notes()->create([ //…

VIEW QUESTION

Laravel many to many whereDoesntHave

I have this code here simplified. Post::whereDoesntHave('tags', function($query){ $query->whereIn(tags.id, $tagIds); }) Lets say that tagIds = [1,2,3] My goal is to retrieve only Posts that do not contain all of those tags. ex. if post has tags 1,2,3 , then…

VIEW QUESTION
Back To Top
Search