1. Go to this page and download the library: Download jonnypickett/eloquent-sti 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/ */
return [
/*
|--------------------------------------------------------------------------
| Default Subclass Field
|--------------------------------------------------------------------------
|
| Subclass class names will be stored and retrieved from this field.
| This can be overridden in specific classes by setting the
| protected property $subclassFiled to a different value
| in the class definition.
|
*/
'subclass_field' => env('ELOQUENT_STI_SUBCLASS_FIELD', 'your_subclass_field_name_here'),
];
class Animal extends Model
{
protected $subclassField = 'your_subclass_field_name_here'
}