44
55use Illuminate \Support \Collection ;
66use Illuminate \Support \Traits \ForwardsCalls ;
7- use ProtoneMedia \LaravelCrossEloquentSearch \Contracts \SearcherContract ;
87
9- class SearchFactory implements SearcherContract
8+ class SearchFactory
109{
1110 use ForwardsCalls;
1211
@@ -21,127 +20,127 @@ public function new(): Searcher
2120 /**
2221 * Add a model to search through.
2322 */
24- public function add ($ query , $ columns = null , string $ orderByColumn = null ): SearcherContract
23+ public function add ($ query , $ columns = null , string $ orderByColumn = null ): Searcher
2524 {
2625 return $ this ->new ()->add ($ query , $ columns , $ orderByColumn );
2726 }
2827
2928 /**
3029 * Add a full-text searchable model.
3130 */
32- public function addFullText ($ query , $ columns = null , array $ options = [], string $ orderByColumn = null ): SearcherContract
31+ public function addFullText ($ query , $ columns = null , array $ options = [], string $ orderByColumn = null ): Searcher
3332 {
3433 return $ this ->new ()->addFullText ($ query , $ columns , $ options , $ orderByColumn );
3534 }
3635
3736 /**
3837 * Add multiple models at once.
3938 */
40- public function addMany (array $ queries ): SearcherContract
39+ public function addMany (array $ queries ): Searcher
4140 {
4241 return $ this ->new ()->addMany ($ queries );
4342 }
4443
4544 /**
4645 * Set the order by column for the most recently added model.
4746 */
48- public function orderBy (string $ orderByColumn ): SearcherContract
47+ public function orderBy (string $ orderByColumn ): Searcher
4948 {
5049 return $ this ->new ()->orderBy ($ orderByColumn );
5150 }
5251
5352 /**
5453 * Order results in ascending order.
5554 */
56- public function orderByAsc (): SearcherContract
55+ public function orderByAsc (): Searcher
5756 {
5857 return $ this ->new ()->orderByAsc ();
5958 }
6059
6160 /**
6261 * Order results in descending order.
6362 */
64- public function orderByDesc (): SearcherContract
63+ public function orderByDesc (): Searcher
6564 {
6665 return $ this ->new ()->orderByDesc ();
6766 }
6867
6968 /**
7069 * Order results by relevance.
7170 */
72- public function orderByRelevance (): SearcherContract
71+ public function orderByRelevance (): Searcher
7372 {
7473 return $ this ->new ()->orderByRelevance ();
7574 }
7675
7776 /**
7877 * Order results by model type.
7978 */
80- public function orderByModel ($ modelClasses ): SearcherContract
79+ public function orderByModel ($ modelClasses ): Searcher
8180 {
8281 return $ this ->new ()->orderByModel ($ modelClasses );
8382 }
8483
8584 /**
8685 * Configure wildcard behavior.
8786 */
88- public function beginWithWildcard (bool $ state = true ): SearcherContract
87+ public function beginWithWildcard (bool $ state = true ): Searcher
8988 {
9089 return $ this ->new ()->beginWithWildcard ($ state );
9190 }
9291
9392 /**
9493 * Configure wildcard behavior.
9594 */
96- public function endWithWildcard (bool $ state = true ): SearcherContract
95+ public function endWithWildcard (bool $ state = true ): Searcher
9796 {
9897 return $ this ->new ()->endWithWildcard ($ state );
9998 }
10099
101100 /**
102101 * Enable case-insensitive searching.
103102 */
104- public function ignoreCase (bool $ state = true ): SearcherContract
103+ public function ignoreCase (bool $ state = true ): Searcher
105104 {
106105 return $ this ->new ()->ignoreCase ($ state );
107106 }
108107
109108 /**
110109 * Enable sounds like searching.
111110 */
112- public function soundsLike (bool $ state = true ): SearcherContract
111+ public function soundsLike (bool $ state = true ): Searcher
113112 {
114113 return $ this ->new ()->soundsLike ($ state );
115114 }
116115
117116 /**
118117 * Configure term parsing.
119118 */
120- public function parseTerm (bool $ state = true ): SearcherContract
119+ public function parseTerm (bool $ state = true ): Searcher
121120 {
122121 return $ this ->new ()->parseTerm ($ state );
123122 }
124123
125124 /**
126125 * Configure pagination.
127126 */
128- public function paginate (int $ perPage = 15 , string $ pageName = 'page ' , int $ page = null ): SearcherContract
127+ public function paginate (int $ perPage = 15 , string $ pageName = 'page ' , int $ page = null ): Searcher
129128 {
130129 return $ this ->new ()->paginate ($ perPage , $ pageName , $ page );
131130 }
132131
133132 /**
134133 * Configure simple pagination.
135134 */
136- public function simplePaginate (int $ perPage = 15 , string $ pageName = 'page ' , int $ page = null ): SearcherContract
135+ public function simplePaginate (int $ perPage = 15 , string $ pageName = 'page ' , int $ page = null ): Searcher
137136 {
138137 return $ this ->new ()->simplePaginate ($ perPage , $ pageName , $ page );
139138 }
140139
141140 /**
142141 * Include model type in results.
143142 */
144- public function includeModelType (string $ key = 'type ' ): SearcherContract
143+ public function includeModelType (string $ key = 'type ' ): Searcher
145144 {
146145 return $ this ->new ()->includeModelType ($ key );
147146 }
0 commit comments