• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

Laravel set default language not working

phplaravellocalization


PHP Snippet 1:

'useAcceptLanguageHeader' => false,

PHP Snippet 2:

'hideDefaultLocaleInURL' => true,

PHP Snippet 3:

public function __construct(){}

PHP Snippet 4:

Route::get('/', function () {
    if (Session::get('language') == 'en') {
        Session::put('language', 'en');
        App::setLocale('en');
        return redirect('main-services/1/1');
    } else {
        Session::put('language', 'ar');
        App::setLocale('ar');
        return redirect('main-services/1/1');
    }
});

Related Snippets

laravel controller function parameters

How to Mock the Request Class in Laravel?

How to add a custom field to all Woocommerce attribute terms using add_action

Laravel 5.2: Unable to locate factory with name [default]

Class AppHttpControllersUserController Does Not Exist

Xdebug in Laravel is not working with VSCode

could not find driver Debian SQL Server PHP

Why does using salted hash on python and php give me different results?

how to use extended ASCII instead of unicode in PHP

Check for PDO Results, If None Display Message, If Yes then Loop Through

How can I format this number correctly using PHP?

Unable to get password for the instance created from AMI

Custom Button next to “ADD TO CART” button of WooCommerce based on Product Type

Get keys from associative array [duplicate]

Group data in a multidimensional array based on two columns

About Contact Privacy policy Terms and conditions