<?php
/**
 * Created by PhpStorm.
 * User: ntaylor-visionware
 * Date: 5/11/18
 * Time: 12:43 PM
 */

namespace Hilco\Models;


trait BypassWith
{
    public static function without($relations = null) {
        $model = new static;

        $with = $relations ?
            collect($model->with)
                ->diff(
                    is_array($relations) ?
                        $relations : [$relations]
                )->toArray() : [];

        $model->with = $with;

        return $model;
    }
}