---
title: "Without the facade — Trading Analytics for Laravel | Roundly"
description: "Inject TradingAnalyticsManager for the same API without static calls, or run the Analytics engine class directly."
url: https://roundly-consulting.com/open-source/docs/trading-analytics-for-laravel/without-facade
language: en
---

[All packages](https://roundly-consulting.com/open-source.md)

[Trading Analytics for Laravel](https://roundly-consulting.com/open-source/docs/trading-analytics-for-laravel.md)

# Without the facade

The facade is the recommended default, not the only way in. It’s a thin layer over RoundlyConsulting\\TradingAnalytics\\TradingAnalyticsManager, the facade root — a container singleton. Inject it through the constructor for the same API with an explicit dependency and no static calls:

```php
use RoundlyConsulting\TradingAnalytics\TradingAnalyticsManager;

final class PerformanceReport
{
    public function __construct(private TradingAnalyticsManager $analytics) {}

    public function build(iterable $rows): array
    {
        return $this->analytics->for($rows)->scale(2)->calculate()->toArray();
    }
}
```

## The engine class

RoundlyConsulting\\TradingAnalytics\\Analytics works on its own, too. Its static for() and make() take a LazyCollection of Trade objects — map rows with Trade::collect() first:

```php
use RoundlyConsulting\TradingAnalytics\Analytics;
use RoundlyConsulting\TradingAnalytics\DataTransferObjects\Trade;

// The engine itself — takes a LazyCollection of Trade objects
Analytics::for(Trade::collect($rows))->calculate();
Analytics::make($trades)->only([Counts::class])->calculate();   // make() is the same constructor
```

## No action classes

The package has no action classes: it is a stateless calculation engine, and the manager only normalises the input and builds the engine. A setting made with using() on the singleton applies to injected managers and the facade alike.

## Show your open-source love

This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.

[More ways to support, including crypto](https://roundly-consulting.com/support-us.md)

By donating, you agree to our [donation terms](https://roundly-consulting.com/donation-terms.md).

[Support our open source work (opens in a new tab)](https://donate.stripe.com/dRmeVe8FX5PF1Qd9pXcEw00) [Join us on Patreon (opens in a new tab)](https://www.patreon.com/cw/roundly)

## Want this built into your product?

We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.

[Get a quote in 48 hours](https://roundly-consulting.com/contact.md) [Browse all packages](https://roundly-consulting.com/open-source/docs/trading-analytics-for-laravel.md)
