trin4ik/laravel-middleware-setlocale

Laravel "SetLocale" middleware from user data, http headers, post data etc

v0.0.1 2022-05-11 22:31 UTC

This package is auto-updated.

Last update: 2024-11-12 04:19:10 UTC


README

Latest Version on Packagist Total Downloads

Simple and stupid package for set locale from user data, http header, post data etc.

Installation

composer require trin4ik/laravel-middleware-setlocale
php artisan vendor:publish --provider "Trin4ik\LaravelMiddlewareSetLocale\MiddlewareSetLocaleServiceProvider"

And add middleware to app/Http/Kernel.php to needs routes middleware, or to global:

<?php
namespace App\Http;
...

class Kernel extends HttpKernel
{
    protected $middleware = [
        ...
        
        \Trin4ik\LaravelMiddlewareSetLocale\Http\Middleware\SetLocale::class
    ];

Usage

in .env or config/setlocale.php u can configure locale sniffer:

Changelog

Please see CHANGELOG for more information what has changed recently.

Security

If you discover any security related issues, please email trin4ik@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.