LukePOLO\LaraCart\LaraCart::getItemModelOptions PHP Method

getItemModelOptions() private method

Gets the item models options based the config.
private getItemModelOptions ( Model $itemModel, array $options = [] ) : array
$itemModel Illuminate\Database\Eloquent\Model
$options array
return array
    private function getItemModelOptions(Model $itemModel, $options = [])
    {
        $itemOptions = [];
        foreach ($options as $option) {
            $itemOptions[$option] = $this->getFromModel($itemModel, $option);
        }
        return array_filter($itemOptions, function ($value) {
            if ($value !== false && empty($value)) {
                return false;
            }
            return true;
        });
    }