PHP code example of arispati / app-locale

1. Go to this page and download the library: Download arispati/app-locale library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

arispati / app-locale example snippets


// app/Http/Kernel.php
protected $middleware = [
    // ...
    \Arispati\AppLocale\Middleware\AppLocale::class
];

// bootstrap/app.php
$app->middleware([
    \Arispati\AppLocale\Middleware\AppLocale::class
]);

// bootstrap/app.php

// Enabled Facade
$app->withFacades(true, [
    '\Arispati\AppLocale\Facades\AppLocale' => 'AppLocale'
]);

// Register service provider
$app->register(\Arispati\AppLocale\ServiceProvider::class);

AppLocale::setLocale('id'); // set app locale to 'id' (Bahasa Indonesia)

AppLocale::getLocale();