This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
Hi all,
i would like to add fields and edits some elements of Page object ,(if i understood well page class).
But i can't find how to have access to fields, like they are inside $fillable but protected and there is not getter and setters .
Thanks for help
Did you ever solve this? I am also trying to add additional fields to a Model's $fillable
array.
Ah yes, so I got this sorted. You have to use your model's addFillable
method. Add the following to your boot()
function in Plugin.php
:
YourModel::extend(function($model) {
$model->addFillable([
'fillable',
'field',
'names'
]);
});
Had to just look inside October's vendor/october/rain/src/Database/Model.php
since there doesn't seem to be any documentation on it.
Last updated
1-4 of 4