Clarity Laravel

abr4xas/clarity-laravel image

Clarity Laravel stats

Downloads
4
Stars
6
Open Issues
0
Forks
0

View on GitHub →

Easy integration of Microsoft Clarity into your Laravel application.

Microsoft Clarity for Laravel.

Easy integration of Microsoft Clarity into your Laravel application.

Installation

You can install the package via composer:

composer require abr4xas/clarity-laravel

You can publish the config file with:

php artisan vendor:publish --tag="clarity-config"

This is the contents of the published config file:

<?php
 
return [
'id' => env('CLARITY_ID', 'XXXXXX'),
'enabled' => env('CLARITY_ENABLED', true),
];

Optionally, you can publish the views using

php artisan vendor:publish --tag="clarity-views"

Usage

  • Create an account: The first thing you need to do is create an account on Microsoft Clarity. You can sign up on their website and follow the steps to create your account. Then, get your tracking code and that's it.
  • Simply add the blade components to your base layout files.

The enabled attribute is optional, but can be used to control the tags integration from blade files that extend the base layout. It accepts true/false. This can still be controlled globally via the .env file should you need to disable the integration global on different environments as well.

<!-- Should be placed in the head -->
<x-clarity::script :enabled="$enabled" />

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.

This package is strongly inspired by Google Tag Manager for Laravel created by @awcodes.

abr4xas photo

SR Backend (PHP / Laravel / WordPress) developer.

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.


Abr4Xas Clarity Laravel Related Articles

Matt Stauffer Joins the PHP Foundation Board — What It Means for Laravel image

Matt Stauffer Joins the PHP Foundation Board — What It Means for Laravel

Read article
Cache Without Overlapping in Laravel 12.47.0 image

Cache Without Overlapping in Laravel 12.47.0

Read article
Translatable Enums image

Translatable Enums

Read article
Simplifying Form Validation with Laravel Livewire's #[Validate] Attribute image

Simplifying Form Validation with Laravel Livewire's #[Validate] Attribute

Read article
Laravel's UsePolicy Attribute: Explicit Authorization Control image

Laravel's UsePolicy Attribute: Explicit Authorization Control

Read article
Enhancing Laravel Queries with Reusable Scope Patterns image

Enhancing Laravel Queries with Reusable Scope Patterns

Read article
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit
Securing Laravel logo

Securing Laravel

The essential security resource for Laravel devs, covering everything you need to keep your apps secure. Sign up to receive weekly security tips and monthly in depth articles, diving deep into security concepts you need to know!

Securing Laravel
Harpoon: Next generation time tracking and invoicing logo

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing
Typesense Search logo

Typesense Search

Typesense is an open source, blazing-fast search engine, optimized for helping you build delightful search experiences for your sites and apps. Natively integrated with Laravel Scout.

Typesense Search
Celebian logo

Celebian

Celebian is a social media marketing agency specializing in helping their clients go viral on TikTok. Whether you're looking to reach a bigger audience or gain more Tiktok followers, likes, and views, they've got you covered.

Celebian
LoadForge logo

LoadForge

Scalable load testing for web apps & APIs. Simulate real-world traffic and identify breaking points and performance limits with powerful, scalable load tests designed for Laravel.

LoadForge