Download the PHP package mafrasil/laravel-sonar without Composer

On this page you can find all versions of the php package mafrasil/laravel-sonar. 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-sonar

Laravel Sonar - Product Analytics

Latest Version on Packagist GitHub Tests Action Status Total Downloads

Laravel Sonar is a powerful product analytics package that makes it easy to track user interactions in your Laravel application. It provides automatic tracking for clicks, hovers, and impressions, with support for custom events.

Features

Installation

You can install the package via composer:

Then install the package and publish the assets:

This will publish the config file, assets and run the migrations.

You can also publish the config file, assets and run the migrations separately:

You can also publish the views of the dashboard:

Optional: Export React Components

If you're using React, you can export the React components and TypeScript types:

This will create React components and hooks in your application's JavaScript directory.

Usage

Data Attributes

The simplest way to track elements is using data attributes:

React Component (Optional)

If you've exported the React components, you can use the SonarTracker component:

Custom Events

Use the useSonar hook for custom event tracking and configuration:

Server-Side Tracking

You can also track events from your PHP code:

Event Types

The package supports the following event types out of the box:

Configuration

You can customize the package behavior in the config/sonar.php file:

JavaScript Configuration

You can configure the JavaScript behavior globally:

Analytics

Laravel Sonar provides several methods to analyze your collected data. You can use these methods to build dashboards or generate reports.

Available Methods

Dashboard & Analytics

CLI Analytics

The package includes a convenient command-line interface for quick analytics overview:

This is particularly useful for quick analytics checks or automated reporting scripts.

Access Control

By default, the Sonar dashboard is only accessible in the local environment.

You can enable it anytime by setting the SONAR_DASHBOARD_ENABLED environment variable to true.

To allow specific users in other environments, configure the allowed emails in your config/sonar.php:

You can also customize the authorization logic by overriding the viewSonar gate in your AuthServiceProvider:

Dashboard Access

The dashboard is available at /sonar and provides:

Using the Facade

The LaravelSonar facade provides various methods for analyzing your tracking data. Here's a comprehensive example:

Available Analytics Methods

Basic Analytics

Detailed Analytics

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.

Inspiration & Acknowledgments

Laravel Sonar was inspired by Pan, a lightweight and privacy-focused PHP product analytics library. While sharing similar core concepts for simple analytics tracking, Laravel Sonar extends the functionality with additional features including:

Credits

License

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


All versions of laravel-sonar with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^10.0||^11.0||^12.0
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 mafrasil/laravel-sonar contains the following files

Loading the files please wait ....