Add new location and user management via CLI

This commit is contained in:
Dane Everitt 2017-09-15 22:13:33 -05:00
parent a498bbc7d5
commit 542d1f8db7
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
10 changed files with 395 additions and 33 deletions

View file

@ -30,6 +30,7 @@ use Illuminate\Database\Query\Expression;
use Pterodactyl\Contracts\Repository\RepositoryInterface;
use Pterodactyl\Exceptions\Model\DataValidationException;
use Pterodactyl\Exceptions\Repository\RecordNotFoundException;
use Pterodactyl\Contracts\Repository\Attributes\SearchableInterface;
abstract class EloquentRepository extends Repository implements RepositoryInterface
{
@ -106,7 +107,7 @@ abstract class EloquentRepository extends Repository implements RepositoryInterf
$instance = $this->getBuilder()->where($fields)->first($this->getColumns());
if (! $instance) {
throw new RecordNotFoundException();
throw new RecordNotFoundException;
}
return $instance;
@ -200,7 +201,12 @@ abstract class EloquentRepository extends Repository implements RepositoryInterf
*/
public function all()
{
return $this->getBuilder()->get($this->getColumns());
$instance = $this->getBuilder();
if (interface_exists(SearchableInterface::class)) {
$instance = $instance->search($this->searchTerm);
}
return $instance->get($this->getColumns());
}
/**