Download the PHP package ohseesoftware/laravel-server-analytics without Composer

On this page you can find all versions of the php package ohseesoftware/laravel-server-analytics. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-server-analytics

Laravel Analytics

Current Release Build Status Badge Coverage Status Maintainability Score Downloads MIT License

Server side analytics for your Laravel application or website. No cookies, no tracking :)

Vision

There are a lot of choices out there when it comes to analytics for your web project. With the progress of GDPR, a focus on privacy has emerged. Consumers are now learning that they can be tracked across the web, and are not appreciative of this.

As you develop your next website or project, you may wish to add analytics so you can see how many pageviews, etc you're getting. You may not care to track how a specific visitor got to your website, or the actions they took once they were there. You just want some basic metrics on the activity on your web project.

You've come to the right place.

Goals

Installation

You can install the package via composer:

Publish the package (config, assets, etc):

Review the configuration file and make changes as necessary:

Run database migrations:

Usage

Basic Usage

For basic request tracking, there's no custom code you need to add to your application other than including the middleware:

If you want to only track a specific middleware group, add it to that group instead of the global $middleware variable.

Tracking authenticated user

v3.0.0+

By default, the package will automatically track the authenticated user who made the request. This is stored directly in the analytics table in the user_id column.

The default migration assumes you users are stored in a users table with a BIGINT field type for the primary key. If your users are not stored like that, you should write your own migration. The package also assumes your User model is located at App\User. If yours is located in a difference namespace, you can update the user_model key in the published config file.

When logging a request, the package will use this code to insert the user_id into the analytics table:

Excluding Routes

If you'd like to exclude specific routes (or wildcards) from being tracked, you can do so via the addRouteExclusions() method:

Excluding Request Methods

If you'd like to exclude specific request methods from being tracked, you can do so via the addMethodExclusions() method:

Excluding Requests From Bots

If you'd like to exclude requests from bots/crawlers, you can set the ignore_bot_requests configuration value to true.

We use the Crawl Detect package to detect bots/crawlers.

Request hooks

We provide took optional hooks that you can use to automatically associate extra data with your analytics records: addMetaHook and addRelationHook. Both hooks return an array of data that should be associated to the analytics record. You can add as many of each as you'd like throughout your request's lifecycle.

addMetaHook example:

addRelationHook example:

There's also helper methods available which call the above hooks for you:

Providing Custom Request Details

We provide sensible defaults for pulling details for the request. However, if you need to pull the details in a different manner, you can provide a custom implementation of the RequestDetails class:

There's a config value, request_details_class, which you can set to the FQN of your request details class. We will attempt to resolve that class out of the container when logging requests.

Querying Analytics Records

You can use the AnalyticsRepository to query data out of the analytics tables. If you need to build a custom query, you can use the query() method on the repository instance.

There's also a couple query scopes setup on the Analytics model.

Filter Analytics records that are related to the a given model:

Filter Analytics records that have metadata with a given key:

Filter Analytics records that have a given metadata key/value pair:

Testing

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.


All versions of laravel-server-analytics with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
doctrine/dbal Version ^3.1
illuminate/bus Version >=8
illuminate/queue Version >=8
illuminate/support Version >=8
jaybizzle/crawler-detect Version ^1.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ohseesoftware/laravel-server-analytics contains the following files

Loading the files please wait ....