Skip to content

Commit 6d92297

Browse files
author
Yoel Monzon
committed
[add] function to create a new query
1 parent 03c1c96 commit 6d92297

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/Repository.php

+9
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,15 @@ public function makeModel()
5858
return $this->model = $model;
5959
}
6060

61+
/**
62+
* Function to return an object of Query Builder
63+
* @return \Illuminate\Database\Eloquent\Builder
64+
*/
65+
public function newQuery()
66+
{
67+
return $this->model->newQuery();
68+
}
69+
6170
/**
6271
* Return all rows of model, select all columns default
6372
* @param array $columns

src/RepositoryInterface.php

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
interface RepositoryInterface
55
{
6+
public function newQuery();
7+
68
public function all($columns = array('*'));
79

810
public function take($limit);

0 commit comments

Comments
 (0)