Skip to content

Macros

use CyrildeWit\EloquentViewable\Support\Granularity;
use CyrildeWit\EloquentViewable\Support\Period;
use CyrildeWit\EloquentViewable\Views;
Views::macro('countByDay', function () {
return $this->countByInterval(Granularity::Day);
});
views($post)->period(Period::pastDays(30))->countByDay();