In certain rare scenarios, you should create an instance of a class and call its methods directly within a Blade view, rather than from a controller. For these cases, Laravel provides the convenient @inject directive:
@inject('metrics', 'App\Services\MetricsService')
<div>
Monthly Revenue: {{ $metrics->monthlyRevenue() }}.
</div>





I looks like a cool trick, but adding an dependency to your template is going to to make it harder to test.
The better way is to add the data you need for the template using the data argument when calling the the view in the controller.
It is also easier to read in the template
Monthly revenue: {{ $monthlyRevenue }}.