PHP code example of esign / laravel-underscore-translatable
1. Go to this page and download the library: Download esign/laravel-underscore-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/ */
esign / laravel-underscore-translatable example snippets
use Esign\UnderscoreTranslatable\UnderscoreTranslatable;
use Illuminate\Database\Eloquent\Model;
class Post extends Model
{
use UnderscoreTranslatable;
public $translatable = ['title'];
}
Schema::create('posts', function (Blueprint $table) {
$table->id();
$table->string('title_nl')->nullable();
$table->string('title_fr')->nullable();
$table->string('title_en')->nullable();
});