Pharaonic
Loading...

Pageable Model

Pageable Model

# Inclusion

This is how you can make the model pageable.
You can ignore using $pagesAttributes variable [ Default: page ].

1use Pharaonic\Laravel\Pages\HasPages;
2 
3class Company extends Model
4{
5 use HasPages;
6 
7 protected $pagesAttributes = ['terms', 'privacy']; // OPTIONAL
8}

Then attach the page with the model.

1$page = page(1);
2$company->terms = $page;