1. Go to this page and download the library: Download trexology/extendable 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 Trexology\Extendable\Traits\Extendable;
class Article extends \Illuminate\Database\Eloquent\Model {
use Extendable;
}
return [
'App\User' => [ // model name
'gender' => [ // field name
'title' => 'Gender', // field title (can be used in views)
'type' => \Trexology\Extendable\CustomFieldType::Radio, // field type
'options' => [ // possible values/labels
'male' => 'Male',
'female' => 'Female'
],
'default' => 'male' // default value
]
]
];