This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

herizo.ludovic16552
herizo.ludovic16552

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

octubreprofavor
octubreprofavor

Did you ever solve this? I am also trying to add additional fields to a Model's $fillable array.

mark268521251
mark268521251

Any update on this? I'm also trying to extend a Plugin's $fillable array.

octubreprofavor
octubreprofavor

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

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.