PHP code example of aenzenith / laravel-localizable
1. Go to this page and download the library: Download aenzenith/laravel-localizable 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/ */
use Aenzenith\LaravelLocalizable\Localizable;
class Content extends Model
{
use HasFactory, Localizable;
protected $localizable = [
'title',
'content',
];
/* ... */
}
$localizables = Content::getLocalizables();
//you can pass also locales list with config('localizable.locales') for language names
return view('content.create', compact('localizables'));