Search
 
SCRIPT & CODE EXAMPLE
 

PHP

laravel default websie ar

//To make the default website with the language AR.
//At first time, the user does not have any session. So, we will add a
//session and set the language to be AR if it is not the first time. 
//Then, depending on the language you choose.

//web.php
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');
    }
});
Comment

PREVIOUS NEXT
Code Example
Php :: php session regenerate id 
Php :: php date strtotime add days 
Php :: laravel get all vendor files 
Php :: laravel eloquent merge request 
Php :: Add Laravel .env variable to Vue component 
Php :: homebrew switch php version 
Php :: disable register laravel 
Php :: how to limit excerpt length in wordpress 
Php :: how to add data to the request object in laravel 
Php :: get file each line in php 
Php :: php artisan make controller model and migration 
Php :: new line in php 
Php :: include php 
Php :: Object of class DateTime could not be converted to string 
Php :: php ip 
Php :: php mysql datetime format string 
Php :: laravel singular 
Php :: array to stdclass object php 
Php :: php curl ssl verify 
Php :: Split 10 email out of 50 email using coma separated via php 
Php :: bind multiple data in one id in php using php using for loop 
Php :: convert 1 digit to five digits laravel 
Php :: mask card php 
Php :: sudo apt-get install php7.0-gd 
Php :: checks number only in php 
Php :: laravel modules slowdown 
Php :: php loop through months 
Php :: laravel route is current route 
Php :: how to run a specific test in laravel 
Php :: how to concat in where clause like laravel query builder 
ADD CONTENT
Topic
Content
Source link
Name
5+9 =