Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

MohamedKamal's avatar

Missing Providers

How could I do this in laravel 11? there's no providers in app.php!

You can install the package via composer:

composer require spatie/laravel-translation-loader
In config/app.php (Laravel) or bootstrap/app.php (Lumen) you should replace Laravel's translation service provider

Illuminate\Translation\TranslationServiceProvider::class,
by the one included in this package:

Spatie\TranslationLoader\TranslationServiceProvider::class,

0 likes
2 replies
puklipo's avatar
puklipo
Best Answer
Level 9

config/app.php providers is sitll works. Add by yourself.

// config/app.php

use Illuminate\Support\ServiceProvider;

    'providers' => ServiceProvider::defaultProviders()->replace([
        Illuminate\Translation\TranslationServiceProvider::class => Spatie\TranslationLoader\TranslationServiceProvider::class,
    ])->toArray(),
1 like

Please or to participate in this conversation.