Download the PHP package builtbyberry/laravel-site-analytics without Composer

On this page you can find all versions of the php package builtbyberry/laravel-site-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-site-analytics

Laravel Site Analytics

First-party event storage, recording, reporting, traffic exclusions and retention for Laravel 13 / PHP 8.3+. Build your own analytics screen in Blade, React/Inertia or another frontend. The package has no frontend, route, auth, mail, queue or application-namespace dependencies.

Boundary

The package owns:

The application owns its event catalog, allowed attributes, public-page policy, authentication, controllers, views, frontend tracking, funnels, scheduling and timezone. The package creates no public endpoint, applies no middleware, sends no email and schedules no task automatically. Bind AnalyticsEventCatalog in the application's provider; override TrafficExclusion to compose site policy with DatabaseTrafficExclusion.

Installation

For a new installation, publish the migrations once, review them, then run them against the intended database:

Migrations create site_events and ignored_site_ips. They are deliberately publish-only, not auto-loaded. If your application already owns these tables and the corresponding historical migrations, keep those migrations and data; do not publish duplicate table creation, rename tables or export/import rows. Back up the database before upgrading. A code rollback should leave analytics tables and their migration history intact.

Configuration is merged automatically. Applications may provide config/analytics.php or publish site-analytics-config. Keep hashing secrets stable. A dedicated secret is optional; the package default uses APP_KEY when it is absent or blank. Existing consumers can override this expression to preserve historical hashes.

A minimal application catalog could look like this:

Bind it in your application provider:

Run collection only after a successful public response. Exclude admin/authentication routes, private signed links, form values and signed-in traffic as appropriate for your site. DatabaseTrafficExclusion only matches explicitly ignored IP addresses; route, bot and prefetch policies belong in the application. Database recording failures return null and are reported through Laravel. If collection must tolerate a missing exclusion table, catch that failure in the application policy as well.

The catalog must declare every event and dimension. The recorder limits scalar dimensions and drops undeclared keys/events. It strips query strings and fragments from paths. Consumers must still exclude sensitive paths and must never allow sensitive dimension values. It does not infer whether an arbitrary string contains personal information. Request metadata is opt-in: pass only sanitized referral hostnames/campaign fields. Raw visitor IPs are not event attributes; explicitly managed exclusion addresses are encrypted for admin display.

Reporting

page_view is the shared page-view event name. Other events, labels and conversion events are application-defined. Report timezone and label come from analytics.timezone and analytics.timezone_label. handle($days, $funnels, $conversionEvent, $pageGroups) returns presentation-neutral arrays. Range is bounded to 1–366 days; the applications expose 7/30/90. Page groups contain trusted path prefixes. Report boundaries are converted from local midnight to UTC; daily buckets handle DST in PHP. Future-dated rows are excluded. The daily scan uses a cursor.

Visits mean distinct hashed Laravel sessions in the selected period, not unique people or timed sessions. No new analytics cookie is issued. Existing framework sessions supply the identifier. Referrals can count the same session under multiple hosts. Funnels preserve the source's independent distinct-session count per step; they are not ordered/cohort conversion funnels. Recent journeys/events retain the source limits (12 sessions / 15 events); a session's journey can still contain many events. This remains a small-site reporting implementation, without rollups or cross-site aggregation.

Retention

Schedule retention explicitly in the consumer:

Run schedule:run using the hosting scheduler. No newsletter worker is involved. retention_months defaults to 13 and has a minimum of one month. Pruning affects only analytics event rows, not exclusions or subscribers.

Validation

Standalone Testbench tests cover a non-civic catalog, recording/privacy, exclusions, unavailable storage, DST reports and retention. The GitHub Actions suite runs on PHP 8.3, 8.4 and 8.5. Application integration suites also exercise existing-data compatibility and both Blade and React/Inertia consumers. Database tests currently use SQLite; PostgreSQL production behavior has not been verified by this package suite.

Laravel package discovery and configuration follow Laravel's package documentation.

License

MIT. See LICENSE.


All versions of laravel-site-analytics with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/database Version ^13.0
illuminate/http Version ^13.0
illuminate/support Version ^13.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 builtbyberry/laravel-site-analytics contains the following files

Loading the files please wait ...