The package enables you to calculate the view count of a resource
luqta/viewcount is a Laravel package for the package enables you to calculate the view count of a resource.
It currently has 0 GitHub stars and 71 downloads on Packagist (latest version v2.0).
Install it with composer require luqta/viewcount.
Discover more Laravel packages by luqta
or browse all Laravel packages to compare alternatives.
Last updated
The package enables you to calculate the view count of a resource (MongoDB Collection).
$ composer require luqta/viewcount
vistor_ip'user_id' => 'string',
'countable' => 'required|boolean',
'vistor_ip' => 'required_if:countable,1|string',
'user_agent' => 'required_if:countable,1|string',
'browser_language' => 'required_if:countable,1|string',
'screen.width' => 'required_if:countable,1|numeric',
'screen.height' => 'required_if:countable,1|numeric',
'inner.width' => 'required_if:countable,1|numeric',
'inner.height' => 'required_if:countable,1|numeric',
view_count field to your resource collection.protected $fillable = [
...
'view_count',
...
];
Luqta\ViewCount\ViewCountJob job in your resource controller.dispatch(new ViewCountJob($model, $request->validated()));
Luqta\ViewCount\Traits\Countable trait in your resource model.