skip to Main Content

Laravel belongsToMany select all specified ids

Relation public function groups() { return $this->belongsToMany('AppModelsItemGroup','item_to_group','item_id','item_group_id'); } ** How to select all Items that have item_group_id 0 and 9 BOTH?** $zero_and_nine_count = AppModelsItem::with(['groups' => function ($query) { $where[] = ['item_group_id', , 0]; $where[] = ['item_group_id', '=', 9]; $query->where($where); }])->count();…

VIEW QUESTION

Unique validation on update Laravel

I have a Laravel application. I am performing the user information update function, but I can't bypass the validation check for the admin_email and admin_title fields in the tbl_admin database. I am using the following FormRequest: <?php namespace AppHttpRequests; use…

VIEW QUESTION
Back To Top
Search