0
How to make pagination in Laravel in hasMany()
method for relations between models in Laravel?
0
How to make pagination in Laravel in hasMany()
method for relations between models in Laravel?
0
Model user:
public function sites() {
return $this->hasMany(Sites::class, 'user_id', 'id');
}
Sites Model:
public function user() {
return $this->belongsTo(User::class,'user_id','id');
}
Controller:
User::find(122)->sites
Source: https://laracasts.com/discuss/channels/laravel/how-to-paginate-eloquent-hasmany-relation
Browser other questions tagged laravel laravel-eloquent
You are not signed in. Login or sign up in order to post.