PHP code example of marshmallow / translatable

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

    

marshmallow / translatable example snippets


'locale' => env('APP_LOCALE', 'en'),

'default_locale' => env('APP_LOCALE'),

use Illuminate\Database\Eloquent\Model;
use Marshmallow\Translatable\Traits\Translatable;

class Article extends Model
{
    use Translatable;
}
bash
php artisan vendor:publish --provider="Marshmallow\Translatable\ServiceProvider"
bash
php artisan translatable:install
bash
# Sync existing translation files to database
php artisan translatable:sync-file-to-database

# Sync missing translations
php artisan translatable:sync-missing

# Generate Nova resources (if using Laravel Nova)
php artisan marshmallow:resource Language Translatable --force
php artisan marshmallow:resource Translation Translatable --force