skip to Main Content

Splitting Paginated Blade – Laravel

Below is my controller code $category_ids = array(); foreach($categories as $category){ $category_ids[] = $category->id; } $paginated_products = Product::where('status',1)->whereIn('category_id',$category_ids)->latest()->paginate(30); Below is my blade view code $first_ten_products = array_slice($paginated_products,0,9); But am getting the error below how can i fix it. Thanks array_slice():…

VIEW QUESTION

Postgresql – Select joined table with same column name but different value using eloquent

I'm trying to call 2 columns from 2 different tables. applicants.ic_no and agents.ic_no. It have different values. Using the following codes only displayed only ic_no from agents.ic_no $claimLists = ClaimDetail::join('applicants', 'applicants.ic_no', '=', 'claim_details.ic_no') ->join('agents', 'agents.id', '=', 'claim_details.agent_id') ->where('claim_date', $cutt_off) ->groupBy('agents.id',…

VIEW QUESTION
Back To Top
Search