Silber\Bouncer\Database\IsRole::createAssignRecords PHP Method

createAssignRecords() protected method

Create the pivot table records for assigning the role to given models.
protected createAssignRecords ( Model $model, array $keys ) : array
$model Illuminate\Database\Eloquent\Model
$keys array
return array
    protected function createAssignRecords(Model $model, array $keys)
    {
        $type = $model->getMorphClass();
        return array_map(function ($key) use($type) {
            return ['role_id' => $this->getKey(), 'entity_type' => $type, 'entity_id' => $key];
        }, $keys);
    }