-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
20 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ | |
use Illuminate\Http\Request; | ||
|
||
/** | ||
* @package Binaryk\LaravelRestify\Contracts; | ||
* @author Eduard Lupacescu <[email protected]> | ||
*/ | ||
interface RestifySearchable | ||
|
@@ -42,7 +41,7 @@ public static function getInFields(); | |
* Find matches in the table by given value | ||
* Returns an array like: | ||
* [ 'table_column_name' => 'type' ], type can be: text, bool, boolean, int, integer, number | ||
* e.g. [ 'id' => 'int' ] | ||
* e.g. [ 'id' => 'int' ]. | ||
* | ||
* To use this filter we have to send in query: | ||
* [ 'match' => [ 'id' => 1 ] ] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,12 +2,7 @@ | |
|
||
namespace Binaryk\LaravelRestify\Controllers; | ||
|
||
use Binaryk\LaravelRestify\Tests\Fixtures\User; | ||
use Illuminate\Database\Eloquent\Model; | ||
use Illuminate\Http\Request; | ||
|
||
/** | ||
* @package Binaryk\LaravelRestify\Controllers; | ||
* @author Eduard Lupacescu <[email protected]> | ||
*/ | ||
trait RestIndexController | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,14 +5,13 @@ | |
use Illuminate\Http\Request; | ||
|
||
/** | ||
* @package Binaryk\LaravelRestify\Traits; | ||
* @author Eduard Lupacescu <[email protected]> | ||
*/ | ||
trait InteractWithSearch | ||
{ | ||
use AuthorizableModels; | ||
|
||
static $defaultPerPage = 15; | ||
public static $defaultPerPage = 15; | ||
|
||
/** | ||
* @return array | ||
|
@@ -45,6 +44,7 @@ public static function getMatchByFields() | |
{ | ||
return static::$match ?? []; | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ | |
use Binaryk\LaravelRestify\Tests\Fixtures\User; | ||
|
||
/** | ||
* @package Binaryk\LaravelRestify\Tests; | ||
* @author Eduard Lupacescu <[email protected]> | ||
*/ | ||
trait InteractWithModels | ||
|
@@ -14,12 +13,11 @@ public function mockUsers($count = 1) | |
{ | ||
$users = collect([]); | ||
$i = 0; | ||
while($i < $count) { | ||
while ($i < $count) { | ||
$users->push(factory(User::class)->create()); | ||
$i++; | ||
} | ||
|
||
return $users; | ||
} | ||
|
||
} |