Domain\Repositories\Traits\GetsTrait::getByIds PHP Method

getByIds() public method

Get items of model by ids :ids.
public getByIds ( array $ids, array $columns = ['*'], array $with = [], array $load = [] ) : Illuminate\Database\Eloquent\{Collection,
$ids array
$columns array
$with array
$load array
return Illuminate\Database\Eloquent\{Collection,
    public function getByIds(array $ids, array $columns = ['*'], array $with = [], array $load = [])
    {
        $items = $this->model;
        if (!empty($with)) {
            $items = $items->with($with);
        }
        $items = $items->find($id, $columns);
        if (!empty($load) and !is_null($items)) {
            $items->load($load);
            return $items;
        }
        if ($items) {
            return $items;
        }
        throw new RepositoryException('Items not found');
    }