Download the PHP package njoguamos/laravel-plausible without Composer

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

Plausible Analytics for Laravel 10+

Latest Version on Packagist Total Downloads GitHub Tests Action Status GitHub Workflow Status

Plausible is intuitive, lightweight and open source web analytics. Plausible has no cookies and fully compliant with GDPR, CCPA and PECR.

Installation

You can install the package via composer:

You can initialise the package with:

Install command will publish the config file.

Ensure that you have updated your application .env with credentials from Plausible i.e.

Note If you are using a self-hosted version of plausible, ensure that you define PLAUSIBLE_BASE_URL to point to your custom domain.

Usage

1. Getting Realtime Visitors

To get the current visitors on your default site, run a request as follows.

The response in a single digit number

If you prefer using facades, then you can do as follows.

2. Getting Aggregates

To get the aggregates, run a request as follows.

[Note] Filtering by imported data is limited. The general rule is that you cannot filter by two different properties at the same time. Learn more from Plausible Imported stats documentation

A successful response will be a json. Example;

Aggregates parameters explained expand to view more details.

Period - string, optional The `period` MUST be either of the allowed ones i.e `12mo`,`6mo`,`month`,`0d`,`7d`,`day`, or `custom`. If not provided, period will default to `30d`;
Metrics - array, optional The `metrics` must contain either of the allowed ones i.e `visitors`,`visits`,`pageviews`,`views_per_visit`,`bounce_rate`,`visit_duration`, or `events`. If not provided, all metrics will be included.
Compare - boolean, optional `compare` defaults to `true`, meaning that the percent difference with the previous period for each metric will be calculated.
Filters - array, optional Your filters must be properly formed as per [plausible instructions](https://plausible.io/docs/stats-api#filtering). Filters defaults to `null`.
Date - string, optional Date in `Y-m-d` format. Individual date e.g `2023-01-04` or a range `2023-01-01,2023-01-31`. When not provided, date defaults to `current date`. >**Info** > You must include `period: 'custom'` when you provide a date range.

3. Getting Time Series

To get the timeseries data over a certain time period, run a request as follows.

A successful response will be a json. Example;

Timeseries parameters explained expand to view more details.

Period - string, optional The `period` MUST be either of the allowed ones i.e `12mo`,`6mo`,`month`,`0d`,`7d`,`day`, or `custom`. If not provided, period will default to `30d`;
Metrics - array, optional The `metrics` must contain either of the allowed ones i.e `visitors`,`visits`,`pageviews`,`views_per_visit`,`bounce_rate`,`visit_duration`, or `events`. If not provided, all metrics will be included.
Filters - array, optional Your filters must be properly formed as per [plausible instructions](https://plausible.io/docs/stats-api#filtering). Filters defaults to `null`.
Interval - string, optional Interval can only be either `month` or `date`. When not provided, it defaults to date.
Date - string, optional Date in `Y-m-d` format. Individual date e.g `2023-01-04` or a range `2023-01-01,2023-01-31`. When not provided, date defaults to `current date`. >**Info** > You must include `period: 'custom'` when you provide a date range.

4. Getting Breakdowns

To get a breakdown of your stats by some property, run a request as follows.

The response in a single digit number

Breakdown parameters explained expand to view more details.

Property - string, optional The `property` MUST be either of the allowed ones i.e. `visitors`, `visits`, `pageviews`, `bounce_rate`, or `visit_duration`. If not provided, period will default to all allowed;
Period - string, optional The `period` MUST be either of the allowed ones i.e `12mo`,`6mo`,`month`,`0d`,`7d`,`day`, or `custom`. If not provided, period will default to `30d`;
Date - string, optional Date in `Y-m-d` format. >**Info** > `period: 'custom'` is not supported. `date: '2023-01-01,2023-02-02' is not supported.
Metrics - array, optional The `metrics` must contain either of the allowed ones i.e `visitors`,`visits`,`pageviews`,`views_per_visit`,`bounce_rate`,`visit_duration`, or `events`. If not provided, all metrics will be included.
Limit - int, optional The results limit. It must be between `1` and `1000`. When not provided, limit defaults to `100`.
Page - int, optional Page for the results. When not provided, page defaults to `1`.
Filters - string, optional Your filters must be properly formed as per [plausible instructions](https://plausible.io/docs/stats-api#filtering). Filters defaults to `null`. >**Info** > Multiple filters are not supported.

5. Caching Response

To increased performance of your application and reduce reliance to plausible api, all requests are cached for 3 minutes. You can specify cache duration (in seconds) and driver using the following env variables.

If for some reason you don't want to cache response, you can turn off caching entirely by adding the following env variable.

Testing

Info To test this package, run the following command.

Changelog

Please see releases 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

License

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


All versions of laravel-plausible with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1 | ^8.2 | ^8.3
guzzlehttp/guzzle Version ^7.5
illuminate/contracts Version ^10.0 | ^11.0
saloonphp/cache-plugin Version ^3.0
saloonphp/laravel-plugin Version ^3.0
spatie/laravel-package-tools Version ^1.16
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 njoguamos/laravel-plausible contains the following files

Loading the files please wait ....