Skip to content
Nav

Install

composer require langsys/langsys-php-laravel
Packagist version Monthly downloads License PHP 8.1+ Laravel 10 / 11 / 12
  1. Require the package and publish the config:

    Terminal window
    composer require langsys/langsys-php-laravel
    php artisan vendor:publish --tag=langsys-config
  2. Set credentials in .env:

    LANGSYS_API_KEY=your-api-key
    LANGSYS_PROJECT_ID=your-project-id

    No project or keys yet? The Quickstart gets you both in two minutes.

  3. Add the middleware to your web group (or per-route via the langsys.locale / langsys.flush aliases):

    bootstrap/app.php
    ->withMiddleware(function (Middleware $middleware) {
    $middleware->web(append: [
    \Langsys\Laravel\Http\Middleware\DetectLocale::class,
    \Langsys\Laravel\Http\Middleware\FlushPendingRegistrations::class,
    ]);
    })
  • Write key (development): phrases rendered through t() / @t that aren’t in the catalog yet are queued and auto-registered at the end of the request.
  • Read-only key (production): lookups only — no token creation.

The key type is detected server-side; there is no local toggle.

See configuration for the rest of config/langsys.php.

Feedback