PHP code example of rahmanramsi / laravel-translatable
1. Go to this page and download the library: Download rahmanramsi/laravel-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/ */
rahmanramsi / laravel-translatable example snippets
return [
'model' => Translate::class,
];
use Illuminate\Database\Eloquent\Model;
use RahmanRamsi\LaravelTranslatable\HasTranslations;
class Post extends Model
{
use HasTranslations;
public array $translatable = ['title'];
}
$post->title = 'hello';
public function setTranslation(string $key, string $locale, string $value)