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

all() public method

Get all item of model.
public all ( array $columns = ['*'], array $with = [], array $orders = [], integer $limit = 50, integer $page = 1 ) : Illuminate\Pagination\LengthAwarePaginator
$columns array
$with array
$orders array
$limit integer
$page integer
return Illuminate\Pagination\LengthAwarePaginator
    public function all(array $columns = ['*'], array $with = [], $orders = [], $limit = 50, $page = 1)
    {
        $all = $this->model;
        if (!empty($with)) {
            $all = $all->with($with);
        }
        foreach ($orders as $order) {
            $order['order'] = isset($order['order']) ? $order['order'] : 'ASC';
            $all = $all->orderBy($order['column'], $order['order']);
        }
        $all = $all->paginate($limit, $columns, 'page', $page);
        return $all;
    }