🚀 Hostinger Optimized
🖥️ Server: LiteSpeed
💻 System: Linux s20058.bom1.stableserver.net 5.14.0-611.55.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 19 15:19:29 EDT 2026 x86_64
👤 User: skhata (1324)
🐘 PHP: 8.4.20
🚫 Disabled: ✨ NONE

💻 Terminal

📁 /home/skhata/chandrasons.com/public
$

📄 SetLocale.php

📁 Path: /home/skhata/chandrasons.com/app/Http/Middleware/SetLocale.php
📊 Size: 591 B
🔒 Perm: 0644
📝 MIME: text/x-php
<?php
namespace App\Http\Middleware;

use Closure;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;

class SetLocale {
    protected array $supported = ['en', 'ne', 'hi'];

    public function handle(Request $request, Closure $next): Response {
        $lang = $request->segment(1);
        if (in_array($lang, $this->supported)) {
            app()->setLocale($lang);
            session(['locale' => $lang]);
        } else {
            $locale = session('locale', 'en');
            app()->setLocale($locale);
        }
        return $next($request);
    }
}
← Back📥 Raw✏️ Edit🔒 Chmod
✨ File Manager Magic ✨