PHP code example of victormgomes / auto-translate
1. Go to this page and download the library: Download victormgomes/auto-translate 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/ */
victormgomes / auto-translate example snippets
use Victormgomes\AutoTranslate\Concerns\AutoTranslatable;
use Victormgomes\AutoTranslate\AutoTranslate;
use Spatie\Translatable\HasTranslations;
#[AutoTranslate(fields: ['name'])]
class Category extends Model
{
use AutoTranslatable, HasTranslations;
public $translatable = ['name'];
}
bash
php artisan vendor:publish --tag="auto-translate-migrations"
php artisan migrate