PHP code example of kg-bot / laravel-localization-to-vue
1. Go to this page and download the library: Download kg-bot/laravel-localization-to-vue 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/ */
kg-bot / laravel-localization-to-vue example snippets
// inside ServiceProvider
// With alias
use ExportLocalization;
// Without alias
use KgBot\LaravelLocalization\Facades\ExportLocalizations as ExportLocalization;
View::composer( 'view.file', function ( $view ) {
return $view->with( [
'messages' => ExportLocalization::export()->toArray(),
] );
} );
// Call toFlat() instead of toArray()
ExportLocalization::export()->toFlat()
or
// For CLI usage
php artisan export:messages-flat
` php artisan export:messages
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.