Valency
Valency

Reputation: 107

Laravel 4: Pagination always returning null

According to the Laravel 4 paginations docs page, this should be providing me with pagination.

I have 3 returned results for this query:

$florist = Florist::all();

I paginate it:

$florist = Florist::paginate(1);

And in my view I have added:

{{ $florist->links }}

Yet nothing is displayed. If I do a var_dump of $florist->links it always returns null. Changing the pagination number in the query makes no difference.

Any ideas?

Thanks for your help.

Upvotes: 0

Views: 923

Answers (1)

Fad
Fad

Reputation: 9858

links is not a property but a method. To print out the links you need to call that method.

{{ $florist->links() }}

Upvotes: 1

Related Questions