Download the PHP package lancodev/laravel-analytics without Composer
On this page you can find all versions of the php package lancodev/laravel-analytics. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lancodev/laravel-analytics
More information about lancodev/laravel-analytics
Files in lancodev/laravel-analytics
Package laravel-analytics
Short Description Laravel Analytics
License MIT
Homepage https://github.com/lancodev/laravel-analytics
Informations about the package laravel-analytics
Laravel Analytics
This package provides a simple way to capture site analytics within your existing Laravel application.
Installation
Install the package via composer:
Publish the components and views:
Run the package's install command:
Usage
Trackable Trait
The package provides an optional Trackable
trait that can be used to assign page view analytics to a model. The trait provides a pageViews
relationship that can be used to retrieve the page views for the model.
This would typically be implemented by the User
model. However, it could also be implemented by any other model that you wish to track page views for.
To use the trait, simply add the following to your model:
Tracking
To begin tracking analytics, add the <x-analytics-analytics />
component to your layout file(s).
This will add the necessary JavaScript to your application.
content
The <x-analytics-analytics />
component accepts the following props:
- trackable: the morphable entity to track
- Example:
<x-analytics-analytics :trackable="auth()->user()" />
- This will associate all page view analytics with the current user
- Example:
Analytics Dashboard
The package also provides a simple dashboard component that can be used to display analytics for your application.
The dashboard can be added to any view by adding the following:
This will add the following to your page:
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Kyle Anderson
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-analytics with dependencies
illuminate/contracts Version ^9.0
jenssegers/agent Version ^2.6
spatie/laravel-package-tools Version ^1.13.0