PHP code example of akaunting / laravel-language

1. Go to this page and download the library: Download akaunting/laravel-language 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/ */

    

akaunting / laravel-language example snippets


Akaunting\Language\Provider::class,

'Language'   => Akaunting\Language\Facade::class,

Route::group(['middleware' => 'language'], function () {

    // Here your routes

});

@foreach (language()->allowed() as $code => $name)
    <a href="{{ language()->back($code) }}">{{ $name }}</a>
@endforeach

{{ route('language::back', ['locale' => $code]) }}

{{ route('language::home', ['locale' => $code]) }}

php artisan vendor:publish --tag=language

php artisan migrate
config/language.php
[$code => $name]
[$code => $name]
[$name => $code]
$name