PHP code example of arthedain / translation

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

    

arthedain / translation example snippets


php artisan vendor:publish --provider="Arthedain\Translation\TranslationServiceProvider" --tag="migration"

php artisan vendor:publish --provider="Arthedain\Translation\TranslationServiceProvider" --tag="model"

php artisan vendor:publish --provider="Arthedain\Translation\TranslationServiceProvider" --tag="config"
`
php artisan vendor:publish --provider="Arthedain\Translation\TranslationServiceProvider" --tag="tinymce"

// composer.json

"autoload": {
    "files": [
        //path to file
    ],
},

// file
<?

function locale(string $name, array $parameters = []): string{
    return \App\Models\Translation::locale($name, $parameters);
}

// view

{{ locale('some text', ['tab' => 'Index']) }}