承接 jeffersongoncalves/laravel-pixel 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

jeffersongoncalves/laravel-pixel

最新稳定版本:2.0.1

Composer 安装命令:

composer require jeffersongoncalves/laravel-pixel

包简介

This Laravel package offers a straightforward way to integrate Meta (Facebook) Pixel into your application. By configuring your Pixel ID, you can effortlessly track user interactions, page views, conversions, and other valuable events on your website. This helps you gather insights into your audienc

README 文档

README

Laravel Pixel

Laravel Pixel

Latest Version on Packagist GitHub Code Style Action Status Total Downloads

This Laravel package offers a straightforward way to integrate Meta (Facebook) Pixel into your application. The Pixel ID is stored in the database using spatie/laravel-settings, allowing you to manage it dynamically (e.g., via an admin panel) without relying on .env files or static config.

Installation

Install the package via composer:

composer require jeffersongoncalves/laravel-pixel

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

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

Publish and run the pixel settings migration:

php artisan vendor:publish --tag="pixel-settings-migrations"
php artisan migrate

Usage

Setting the Pixel ID

You can set the Pixel ID programmatically using any of these methods:

Helper function:

$settings = pixel_settings();
$settings->pixel_id = '123456789';
$settings->save();

Facade:

use JeffersonGoncalves\Pixel\Facades\PixelSettings;

$settings = PixelSettings::getFacadeRoot();
$settings->pixel_id = '123456789';
$settings->save();

Container resolution:

use JeffersonGoncalves\Pixel\Settings\PixelSettings;

$settings = app(PixelSettings::class);
$settings->pixel_id = '123456789';
$settings->save();

Adding the Pixel script to your layout

Include the Blade component in your layout's <head> tag:

@include('pixel::script')

The script will only render when a valid Pixel ID is configured. If the Pixel ID is null or empty, nothing will be rendered.

Reading the Pixel ID

$pixelId = pixel_settings()->pixel_id; // returns string|null

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.

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固