jeffersongoncalves/laravel-plausible 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jeffersongoncalves/laravel-plausible

最新稳定版本:v2.0.1

Composer 安装命令:

composer require jeffersongoncalves/laravel-plausible

包简介

A lightweight Laravel package that seamlessly integrates Plausible Analytics into your Blade views. Plausible.io is a privacy-friendly, open-source alternative to Google Analytics.

README 文档

README

Laravel Plausible

Laravel Plausible

Latest Version on Packagist GitHub Code Style Action Status Total Downloads

A lightweight Laravel package that seamlessly integrates Plausible Analytics into your Blade views. Plausible.io is a privacy-friendly, open-source alternative to Google Analytics.

Settings are stored in the database using spatie/laravel-settings, making it easy to manage from an admin panel or programmatically.

Installation

Install the package via Composer:

composer require jeffersongoncalves/laravel-plausible

Publish and run the settings table migration from spatie/laravel-settings (if not already done):

php artisan vendor:publish --provider="Spatie\LaravelSettings\LaravelSettingsServiceProvider" --tag="migrations"
php artisan migrate

Publish and run the Plausible settings migration:

php artisan vendor:publish --tag=plausible-settings-migrations
php artisan migrate

Usage

Include the script in your layout

Add the following to your Blade layout (inside <head>):

@include('plausible::script')

The script tag will only be rendered when the domains setting is configured.

Configure settings

You can update the settings programmatically:

use JeffersonGoncalves\Plausible\Settings\PlausibleSettings;

$settings = app(PlausibleSettings::class);
$settings->domains = 'example.com';
$settings->save();

Available settings

Setting Type Default Description
domains ?string null Domain(s) to track. Supports rollup reporting with comma-separated domains.
host_analytics string https://plausible.io Plausible host URL. Change this if you are self-hosting Plausible.

Self-hosted Plausible

If you are self-hosting Plausible, update the host_analytics setting:

$settings = app(PlausibleSettings::class);
$settings->host_analytics = 'https://analytics.example.com';
$settings->save();

Testing

composer test

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

License

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

统计信息

  • 总下载量: 28
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 2
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: Blade

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-09-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固