• 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

HTML and PHP in one file

Distribute array row data to make multiple new rows

Star and Half Star Rating in Laravel

PHP only Hit Counter?

How to upload mpdf file after generating to s3 bucket in php

how to search for a file with php

NGINX: connect() to unix:/var/run/php7.2-fpm.sock failed (2: No such file or directory)

Loading data from MySQL and populating dropdown select with jQuery Mobile, PHP

PHP mail sending empty mails

woocommerce get_order_report_data to show order_item_id

Get number of working days between two dates in PHP [duplicate]

PHP: Calling MySQL Stored Procedure with Both INPUT AND OUTPUT Parameters (NOT "INOUT")

JSON Render Issue in Date Object Laravel and PHP 7.4

Artisan, creating tables in database

Laravel Command Schedule Not Working Properly

About Contact Privacy policy Terms and conditions