Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Controllers/RestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
use Binaryk\LaravelRestify\Exceptions\Guard\GatePolicy;
use Binaryk\LaravelRestify\Exceptions\InstanceOfException;
use Binaryk\LaravelRestify\Http\Requests\RestifyRequest;
use Binaryk\LaravelRestify\Repositories\Repository;
use Binaryk\LaravelRestify\Services\Search\SearchService;
use Binaryk\LaravelRestify\Traits\PerformsQueries;
use Illuminate\Config\Repository as Config;
use Binaryk\LaravelRestify\Repositories\Repository;
use Illuminate\Container\Container;
use Illuminate\Contracts\Auth\Access\Gate;
use Illuminate\Contracts\Auth\Authenticatable;
Expand Down Expand Up @@ -144,7 +144,7 @@ public function search($modelClass, $filters = [])
});

/**
* @var \Illuminate\Pagination\Paginator $paginator
* @var \Illuminate\Pagination\Paginator
*/
$paginator = $results->paginate($this->request()->get('perPage') ?? ($modelClass::$defaultPerPage ?? RestifySearchable::DEFAULT_PER_PAGE));
if ($modelClass instanceof Repository) {
Expand Down
3 changes: 2 additions & 1 deletion src/Http/Requests/InteractWithRepositories.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,14 @@ public function newRepository()
}

/**
* Check if the route is resolved by the Repository class, or it uses the classical Models
* Check if the route is resolved by the Repository class, or it uses the classical Models.
* @return bool
*/
public function isResolvedByRestify()
{
try {
$this->repository();

return true;
} catch (EntityNotFoundException $e) {
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/Repositories/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ abstract class Repository implements RestifySearchable
DelegatesToResource;

/**
* This is named `resource` because of the forwarding properties from DelegatesToResource trait
* This is named `resource` because of the forwarding properties from DelegatesToResource trait.
* @var Model
*/
public $resource;
Expand Down
2 changes: 1 addition & 1 deletion src/Services/Search/SearchService.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class SearchService extends Searchable
*/
public function search(RestifyRequest $request, Model $model)
{
if ( ! $model instanceof RestifySearchable) {
if (! $model instanceof RestifySearchable) {
return $model->newQuery();
}

Expand Down