PHPackages                             mliviu79/laravel-langfuse-prism - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. mliviu79/laravel-langfuse-prism

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

mliviu79/laravel-langfuse-prism
===============================

Seamless integration of Langfuse observability for Laravel and Laravel Prism.

v0.1.0(4mo ago)355↓50%[1 issues](https://github.com/Mliviu79/laravel-langfuse-prism/issues)MITPHPPHP ^8.2|^8.3|^8.4CI passing

Since Jan 13Pushed 3mo agoCompare

[ Source](https://github.com/Mliviu79/laravel-langfuse-prism)[ Packagist](https://packagist.org/packages/mliviu79/laravel-langfuse-prism)[ RSS](/packages/mliviu79-laravel-langfuse-prism/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (13)Versions (3)Used By (0)

Laravel Langfuse Prism
======================

[](#laravel-langfuse-prism)

[![Latest Version on Packagist](https://camo.githubusercontent.com/044623fad4cceb20cbfdaf3af836555239bce974b54da9dd8a352a82f6ef90fd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6c6976697537392f6c61726176656c2d6c616e67667573652d707269736d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mliviu79/laravel-langfuse-prism)[![GitHub Tests Action Status](https://camo.githubusercontent.com/dbff3844bea20bda933e349e51e1d0bcc2f6d0dc6259097c3437fc17066b7941/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d6c6976697537392f6c61726176656c2d6c616e67667573652d707269736d2f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/mliviu79/laravel-langfuse-prism/actions?query=workflow%3Atests+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/0468e595f6e2d8caf9d94ecff0ce4b868601e9f85cb59476ba08314276afa32f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6c6976697537392f6c61726176656c2d6c616e67667573652d707269736d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mliviu79/laravel-langfuse-prism)

A comprehensive PHP SDK for the [Langfuse](https://langfuse.com) observability platform, featuring native integration with **Laravel** and **Laravel Prism**.

This package provides a seamless way to trace your LLM applications, monitor costs, and debug complex AI workflows directly within your Laravel application.

✨ Features
----------

[](#-features)

- 🚀 **Deep Prism Integration**: Automatically traces all Prism LLM operations (text, embeddings, images, audio).
- 🔍 **Full Observability**: Detailed span hierarchy, latency tracking, and error monitoring.
- 💰 **Cost &amp; Usage Tracking**: Automatic token counting and cost calculation for supported models.
- ⚡ **Performance**: Non-blocking OpenTelemetry-based tracing with queued background exports.
- 🎨 **Laravel Native**: Service provider, Facade, config publication, and queue integration.
- 📊 **Media Support**: Handles image, document, and audio inputs/outputs.

📦 Installation
--------------

[](#-installation)

```
composer require mliviu79/laravel-langfuse-prism
```

### Laravel Setup

[](#laravel-setup)

1. Publish the configuration file:

```
php artisan vendor:publish --tag=langfuse-config
```

2. Add your Langfuse credentials to `.env`:

```
LANGFUSE_PUBLIC_KEY=pk-lf-your-public-key
LANGFUSE_SECRET_KEY=sk-lf-your-secret-key
LANGFUSE_HOST=https://cloud.langfuse.com
```

🚀 Quick Start with Prism
------------------------

[](#-quick-start-with-prism)

The package automatically detects Prism events. Simply enable it in your config (enabled by default):

```
// config/langfuse.php
'prism' => [
    'auto_trace' => true,
    'trace_model_params' => true,
    'trace_usage' => true,
    'trace_cost' => true,
],
```

Now, any Prism call is automatically traced:

```
use Prism\Prism\Facades\Prism;

// This operation will be automatically traced in Langfuse
$response = Prism::text()
    ->using('anthropic', 'claude-3-opus')
    ->withPrompt('Explain quantum computing like I am 5')
    ->generate();
```

### Manual Tracing

[](#manual-tracing)

For non-Prism logic or custom workflows, use the Facade:

```
use Langfuse\Integration\Laravel\Facades\Langfuse;

$span = Langfuse::startSpan('my-custom-operation');

try {
    // ... your code ...
    $span->end();
} catch (\Exception $e) {
    $span->update(level: 'ERROR', statusMessage: $e->getMessage());
    $span->end();
    throw $e;
}
```

⚠️ Maintenance &amp; Philosophy
-------------------------------

[](#️-maintenance--philosophy)

This package was originally refactored from `laravel-langfuse` to specifically solve our needs for **native Laravel Prism integration** and **robust OpenTelemetry support**.

We are sharing this in the spirit of open source, hoping it helps others with similar requirements. However, please note:

- **Updates:** We maintain this package primarily to support our own production applications. Updates will be released as our needs evolve.
- **Contributions:** We welcome Pull Requests! If you need a feature we don't use, please submit a PR. We are happy to merge community contributions that align with the package's goals.
- **Forking:** If your use case diverges significantly from ours, we encourage you to fork the repository and adapt it to your needs.

We aim to keep the package stable and usable, but we may not prioritize features that aren't relevant to our internal use cases.

🤝 Contributing
--------------

[](#-contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

📄 License
---------

[](#-license)

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

🏆 Credits
---------

[](#-credits)

- **Original Creator:** [Hanan](mailto:hanan@showdigs.com)
- **Maintainer:** [Liviu Muresan](mailto:muresan_liviu@yahoo.com)

Built with ❤️ for the Laravel community.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance71

Regular maintenance activity

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

120d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/92d79be97aa7d09661e23824cc28cb60253a6c8f60de020507c5c76b8f79ba40?d=identicon)[Mliviu79](/maintainers/Mliviu79)

---

Top Contributors

[![Mliviu79](https://avatars.githubusercontent.com/u/102729321?v=4)](https://github.com/Mliviu79 "Mliviu79 (20 commits)")[![google-labs-jules[bot]](https://avatars.githubusercontent.com/in/842251?v=4)](https://github.com/google-labs-jules[bot] "google-labs-jules[bot] (1 commits)")

---

Tags

laravelaitracingopentelemetryprismobservabilityllmlangfuse

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mliviu79-laravel-langfuse-prism/health.svg)

```
[![Health](https://phpackages.com/badges/mliviu79-laravel-langfuse-prism/health.svg)](https://phpackages.com/packages/mliviu79-laravel-langfuse-prism)
```

###  Alternatives

[keepsuit/laravel-opentelemetry

OpenTelemetry integration for laravel

142347.8k](/packages/keepsuit-laravel-opentelemetry)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
