Install
composer require langsys/langsys-php-laravel -
Require the package and publish the config:
Terminal window composer require langsys/langsys-php-laravelphp artisan vendor:publish --tag=langsys-config -
Set credentials in
.env:LANGSYS_API_KEY=your-api-keyLANGSYS_PROJECT_ID=your-project-idNo project or keys yet? The Quickstart gets you both in two minutes.
-
Add the middleware to your
webgroup (or per-route via thelangsys.locale/langsys.flushaliases):bootstrap/app.php ->withMiddleware(function (Middleware $middleware) {$middleware->web(append: [\Langsys\Laravel\Http\Middleware\DetectLocale::class,\Langsys\Laravel\Http\Middleware\FlushPendingRegistrations::class,]);})// app/Http/Kernel.php — append to the `web` group\Langsys\Laravel\Http\Middleware\DetectLocale::class,\Langsys\Laravel\Http\Middleware\FlushPendingRegistrations::class,
API key permissions
Section titled “API key permissions”- Write key (development): phrases rendered through
t()/@tthat 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.