Start ripping out old search functionality for models
This commit is contained in:
parent
3c7ffaaadb
commit
4dddcaebb0
16 changed files with 15 additions and 182 deletions
|
@ -5,7 +5,6 @@ namespace Pterodactyl\Models;
|
|||
use Symfony\Component\Yaml\Yaml;
|
||||
use Illuminate\Container\Container;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Pterodactyl\Models\Traits\Searchable;
|
||||
use Illuminate\Contracts\Encryption\Encrypter;
|
||||
|
||||
/**
|
||||
|
@ -40,7 +39,6 @@ use Illuminate\Contracts\Encryption\Encrypter;
|
|||
class Node extends Model
|
||||
{
|
||||
use Notifiable;
|
||||
use Searchable;
|
||||
|
||||
/**
|
||||
* The resource name for this model when it is transformed into an
|
||||
|
@ -95,18 +93,6 @@ class Node extends Model
|
|||
'description', 'maintenance_mode',
|
||||
];
|
||||
|
||||
/**
|
||||
* Fields that are searchable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $searchableColumns = [
|
||||
'name' => 10,
|
||||
'fqdn' => 8,
|
||||
'location.short' => 4,
|
||||
'location.long' => 4,
|
||||
];
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
|
@ -216,7 +202,7 @@ class Node extends Model
|
|||
*/
|
||||
public function getDecryptedKey(): string
|
||||
{
|
||||
return (string) Container::getInstance()->make(Encrypter::class)->decrypt(
|
||||
return (string)Container::getInstance()->make(Encrypter::class)->decrypt(
|
||||
$this->daemon_token
|
||||
);
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
namespace Pterodactyl\Models;
|
||||
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Pterodactyl\Models\Traits\Searchable;
|
||||
use Illuminate\Database\Query\JoinClause;
|
||||
use Znck\Eloquent\Traits\BelongsToThrough;
|
||||
|
||||
|
@ -58,7 +57,6 @@ class Server extends Model
|
|||
{
|
||||
use BelongsToThrough;
|
||||
use Notifiable;
|
||||
use Searchable;
|
||||
|
||||
/**
|
||||
* The resource name for this model when it is transformed into an
|
||||
|
@ -154,21 +152,6 @@ class Server extends Model
|
|||
'backup_limit' => 'integer',
|
||||
];
|
||||
|
||||
/**
|
||||
* Parameters for search querying.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $searchableColumns = [
|
||||
'name' => 100,
|
||||
'uuid' => 80,
|
||||
'uuidShort' => 80,
|
||||
'external_id' => 50,
|
||||
'user.email' => 40,
|
||||
'user.username' => 30,
|
||||
'node.name' => 10,
|
||||
];
|
||||
|
||||
/**
|
||||
* Returns the format for server allocations when communicating with the Daemon.
|
||||
*
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Pterodactyl\Models\Traits;
|
||||
|
||||
use Pterodactyl\Extensions\Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
trait Searchable
|
||||
{
|
||||
public function newEloquentBuilder($query)
|
||||
{
|
||||
return new Builder($query);
|
||||
}
|
||||
}
|
|
@ -8,7 +8,6 @@ use Illuminate\Validation\Rules\In;
|
|||
use Illuminate\Auth\Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Pterodactyl\Models\Traits\Searchable;
|
||||
use Illuminate\Auth\Passwords\CanResetPassword;
|
||||
use Pterodactyl\Traits\Helpers\AvailableLanguages;
|
||||
use Illuminate\Foundation\Auth\Access\Authorizable;
|
||||
|
@ -52,7 +51,6 @@ class User extends Model implements
|
|||
use AvailableLanguages;
|
||||
use CanResetPassword;
|
||||
use Notifiable;
|
||||
use Searchable;
|
||||
|
||||
const USER_LEVEL_USER = 0;
|
||||
const USER_LEVEL_ADMIN = 1;
|
||||
|
@ -120,20 +118,6 @@ class User extends Model implements
|
|||
*/
|
||||
protected $hidden = ['password', 'remember_token', 'totp_secret', 'totp_authenticated_at'];
|
||||
|
||||
/**
|
||||
* Parameters for search querying.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $searchableColumns = [
|
||||
'username' => 100,
|
||||
'email' => 100,
|
||||
'external_id' => 80,
|
||||
'uuid' => 80,
|
||||
'name_first' => 40,
|
||||
'name_last' => 40,
|
||||
];
|
||||
|
||||
/**
|
||||
* Default values for specific fields in the database.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue