PHP code example of awema-pl / module-localization-helper

1. Go to this page and download the library: Download awema-pl/module-localization-helper 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/ */

    

awema-pl / module-localization-helper example snippets


'providers' => [
// [...]
        AwemaPL\LocalizationHelper\LocalizationHelperServiceProvider::class,
],

'aliases' => [
// [...]
        'LocalizationHelper' => AwemaPL\LocalizationHelper\Facades\LocalizationHelper::class,
],

_p('auth.login', 'Login'); // "Login"

return [
    "login" => "Login"
];

_p(
    'mail.invitation', 
    'You’re invited to join :company company workspace', 
    ['company' => 'AwemaPL']
);

// in localization file.php
return [
    "test" => "Test string"
];

_p('file.test.new', 'Test string'); // will return "file.test.new"

_p('file.test_2.new', 'Test string'); // will return "Test string"

// and modify localization file:
return [
    "test" => "Test string",
    "test_2" => [
        "new" => "Test string"
    ]
];

php artisan vendor:publish --provider="AwemaPL\LocalizationHelper\LocalizationHelperServiceProvider"