Skip to content

Commit e9f3b64

Browse files
committed
Implements RepositoryCommandContract.php and RepositoryQueryContract.php in BaseRepository.php
1 parent de742f2 commit e9f3b64

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

src/Eloquent/BaseRepository.php

+22-1
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66
use Illuminate\Support\Collection;
77
use Mawuekom\Repository\Contracts\Criteria\RepositoryCriteriaContract;
88
use Mawuekom\Repository\Contracts\RepositoryContract;
9+
use Mawuekom\Repository\Controls\RepositoryCommand;
10+
use Mawuekom\Repository\Controls\RepositoryQuery;
911
use Mawuekom\Repository\Criteria\RepositoryCriteria;
1012
use Mawuekom\Repository\Exceptions\RepositoryException;
1113
use Mawuekom\Repository\Traits\CallsModelMethods;
1214

1315
abstract class BaseRepository implements RepositoryContract, RepositoryCriteriaContract
1416
{
15-
use CallsModelMethods, RepositoryCriteria;
17+
use CallsModelMethods, RepositoryCriteria, RepositoryCommand, RepositoryQuery;
1618

1719
/** @var \Illuminate\Database\Eloquent\Model */
1820
protected $model;
@@ -52,6 +54,13 @@ public function __construct(Collection $collection)
5254
*/
5355
abstract public function model();
5456

57+
/**
58+
* Get the columns on which the search will be done
59+
*
60+
* @return array
61+
*/
62+
abstract public function searchableFields();
63+
5564
/**
5665
* Create model instance
5766
*
@@ -91,6 +100,18 @@ public function resetModel()
91100
$this ->makeModel();
92101
}
93102

103+
/**
104+
* Alias of All method
105+
*
106+
* @param array $columns
107+
*
108+
* @return mixed
109+
*/
110+
public function get($columns = ['*'])
111+
{
112+
return $this ->all($columns);
113+
}
114+
94115
/**
95116
* Query Scope
96117
*

0 commit comments

Comments
 (0)