Video
Description
This Laravel package allows you to associate views with Eloquent models.
Once installed you can do stuff like this:
// Return total views countviews($post)->count(); // Return total views count that have been made since 20 February 2017views($post)->period(Period::since('2017-02-20'))->count(); // Return total views count that have been made between 2014 and 2016views($post)->period(Period::create('2014', '2016'))->count(); // Return total unique views count (based on visitor cookie)views($post)->unique()->count(); // Record a viewviews($post)->record(); // Record a view with a cooldownviews($post)->cooldown(now()->addHours(2))->record();
Related Content on Laravel Daily
Video
Recent Courses on Laravel Daily
Laravel 13 Eloquent: Expert Level
41 lessons
1 h 34 min
Queues in Laravel 13
18 lessons
1 h 12 min read
How to Build Laravel 13 API From Scratch
30 lessons
1 h 23 min