PHP code example of tingo-gmbh / eloquent-translatable
1. Go to this page and download the library: Download tingo-gmbh/eloquent-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/ */
tingo-gmbh / eloquent-translatable example snippets
namespace Tingo\Translatable\Tests\Models;
use Illuminate\Database\Eloquent\Model;
use Tingo\Translatable\Translatable;
class Entity extends Model
{
use Translatable;
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'name',
'category',
'description',
'unit',
'price',
];
/**
* The attributes that are translatable.
*
* @var array<string>
*/
protected array $translatable = [
'name',
'category',
'description',
];
}