Martin1182
5 months ago
668
5
Laravel

Pagination album images

Posted 5 months ago by Martin1182

Hello, can anyone advise me how to do pagination in the model? I have an album with pictures and I would like to see, for example, 20 pictures. Thanks for help

namespace App;

use Illuminate\Database\Eloquent\Model;

class Album extends Model {

protected $fillable =
[
    'title', 'text', 'image'
];
public function images()
{
  return $this->hasMany('App\Image')->latest();
}

}

Please sign in or create an account to participate in this conversation.