Files
pulse/content/integrations/laravel.mdx
Usman Baig 627613dc13 fix: code blocks rendering + consistent styling with ciphera-website /learn
- Convert MDX CodeBlock components to standard markdown code fences
- Add rehype-mdx-code-props to pass filename meta to code components
- Custom pre/code MDX components map fences to CodeBlock
- Add brand color badges (product + category) matching /learn layout
- Match prose styling: orange inline code, orange links, white strong
- Remove brand color background glow (not in /learn)
2026-03-29 01:01:56 +01:00

44 lines
1.1 KiB
Plaintext

---
title: "Laravel"
description: "Add Pulse analytics to your Laravel app. Blade template integration for all Laravel versions."
category: "backend"
brandColor: "#FF2D20"
officialUrl: "https://laravel.com/docs"
relatedIds: ["django", "rails", "wordpress"]
date: "2026-03-28"
---
Add the Pulse script to your Blade layout template with a production guard.
---
## Add to your Blade layout
Use Laravel's `@production` directive to only load the script in production.
```php filename="resources/views/layouts/app.blade.php"
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
@production
<script
defer
data-domain="your-site.com"
src="https://pulse.ciphera.net/script.js"
></script>
@endproduction
<title>@yield('title')</title>
@vite(['resources/css/app.css', 'resources/js/app.js'])
</head>
<body>
@yield('content')
</body>
</html>
```
For more details, see the [Laravel @production docs](https://laravel.com/docs/blade#the-production-directive).