Home
Blogs
Questions
Jobs
Monetize

Home

About Us

Blogs

Questions

Jobs

Monetize

Post Job

banner

Questions about laravel-controller

Read more about laravel-controller

python (12.9k questions)

javascript (9.2k questions)

reactjs (4.7k questions)

java (4.2k questions)

java (4.2k questions)

c# (3.5k questions)

c# (3.5k questions)

html (3.3k questions)

Questions - laravel-controller

how to paginate read notifications in Laravel

I got an error related to the pagination of read notifications. Thank you for your help. This is my controller code that gives this error when it runs public function NotificationsRead(User $user) {...
test-img

user16426192

laravel

laravel-8

laravel-controller

laravel-pagination

laravel-notification

Votes: 0

Answers: 2

Latest Answer

You should do $no = Auth::user()->readNotifications()->latest()->paginate(7); In this way you are ordering descending before pagination. Your code orders the result collection created by pag...
test-img

Jack

laravel withCount() Cardinality violation error when relationship is hasMany

This is my models: //project model class Project extends Model { ..... public function items(){ return $this->hasMany(ProjectItem::class,'project_id'); } } //project items model...
test-img

dev-jim

eloquent

laravel-8

laravel-controller

laravel-models

Votes: 0

Answers: 1

Latest Answer

can you replace your query with this and check Project::select('id','title')->where('company' , $company->id)->withCount('items')->paginate(50);
test-img

Abdul Rehman

Posts

Questions

Blogs

Jobs

The ultimate platform for coders and IT specialists

About

  • Company
  • Support

  • Platform

  • Terms & Conditions
  • Privacy statement
  • Cookie policy
  • Cookie option
  • OnlyCoders © 2025  |  All rights reserved