PHP code example of misaf / vendra-language

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

    

misaf / vendra-language example snippets


'locales' => ['en', 'de', 'fa', 'pt-BR'],

use Misaf\VendraLanguage\Models\Language;

$language = Language::query()->create([
    'locale' => 'en',
    'status' => true,
    'is_default' => true,
    'position' => 1,
]);

use Misaf\VendraLanguage\Models\LanguageLine;

LanguageLine::query()->create([
    'group' => 'navigation',
    'key' => 'dashboard',
    'text' => [
        'en' => 'Dashboard',
        'de' => 'Übersicht',
        'fa' => 'داشبورد',
    ],
]);

__('navigation.dashboard');

LanguageLine::query()->create([
    'namespace' => 'vendra-product',
    'group' => 'attributes',
    'key' => 'name',
    'text' => ['en' => 'Product name'],
]);

__('vendra-product::attributes.name');

$languages = Language::query()->ordered()->get();
bash
composer vendor:publish --tag=vendra-language-migrations
php artisan migrate