PHP code example of ironshark / laravel-extendable
1. Go to this page and download the library: Download ironshark/laravel-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/ */
class Article extends \Illuminate\Database\Eloquent\Model {
use IronShark\Extendable\ModelTrait;
}
return [
'App\Room' => [ // model name
'light' => [ // field name
'title' => 'Light', // field title (can be used in views)
'type' => \IronShark\Extendable\CustomFieldType::Radio, // field type
'options' => [ // possible values/labels
0 => 'Off',
1 => 'On'
],
'default' => 1 // default value
]
]
];