PHP code example of flobbos / laravel-translatable-db
1. Go to this page and download the library: Download flobbos/laravel-translatable-db 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/ */
flobbos / laravel-translatable-db example snippets
namespace MyApp\Models;
use Flobbos\TranslatableDB\TranslatableDB;
use Illuminate\Database\Eloquent\Model as Eloquent;
class Country extends Eloquent
{
use TranslatableDB\TranslatableDB;
public $translationModel = MyApp\Models\CountryAwesomeTranslation::class;
}
namespace MyApp\Models;
use Flobbos\TranslatableDB\TranslatableDB;
use Flobbos\TranslatableDB\Contracts\PolyTrans;
use Illuminate\Database\Eloquent\Model as Eloquent;
class Country extends Eloquent implements PolyTrans
{
use TranslatableDB;
public $translationModel = MyApp\Models\CountryAwesomeTranslation::class;
//Set your polymorphic key here
protected $translationForeignKey = 'translatable';
}
'middleware_default' => false
bash
php artisan vendor:publish
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.