src/Database/Concerns/IsRole.php
protected function createAssignRecords(Model $model, array $keys)
    {
        $type = $model->getMorphClass();

        return array_map(function ($key) use ($type) {
            return Models::scope()->getAttachAttributes() + [
                'role_id'     => $this->getKey(),
                'entity_type' => $type,
                'entity_id'   => $key,
            ];
        }, $keys);
    }
protected function createAssignRecords(Model $model, array $keys)
    {
        $type = $model->getMorphClass();

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

@param  \Illuminate\Database\Eloquent\Model  $model
@param  array  $keys
@return array
Create the pivot table records for assigning the role to given models .