PHP code example of deargonauten / translaravel

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

    

deargonauten / translaravel example snippets

 php
deArgonauten\TransLaravel\TransLaravelServiceProvider::class,
 bash
$ php artisan translaravel:install
 php
Lang::addLanguage('locale');
// en, nl, de, fr, et cetera
 php
trans('A string, even with <b>some</b> HTML');
Lang::get('A string, even with <b>some</b> HTML');
 php
$model->name; // It will automaticly fetch the translation set in Application.
$model->getTranslationFor('attribute', 'locale');
 php
Route::get(
	Lang::route('/this-is-a-page'), function()
	{
		return view('pages.contact');
	});