Thats enough re-theming for the day...

This commit is contained in:
Dane Everitt 2017-02-18 19:31:44 -05:00
parent 911434d033
commit b926d432e8
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
15 changed files with 733 additions and 38 deletions

View file

@ -29,11 +29,12 @@ use Cache;
use Javascript;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;
use Nicolaslopezj\Searchable\SearchableTrait;
use Illuminate\Database\Eloquent\SoftDeletes;
class Server extends Model
{
use Notifiable, SoftDeletes;
use Notifiable, SearchableTrait, SoftDeletes;
/**
* The table associated with the model.
@ -85,6 +86,22 @@ class Server extends Model
'installed' => 'integer',
];
protected $searchable = [
'columns' => [
'servers.name' => 10,
'servers.username' => 10,
'servers.uuidShort' => 9,
'servers.uuid' => 8,
'users.email' => 6,
'users.username' => 6,
'nodes.name' => 2,
],
'joins' => [
'users' => ['users.id', 'servers.owner_id'],
'nodes' => ['nodes.id', 'servers.node_id'],
],
];
/**
* Returns a single server specified by UUID.
* DO NOT USE THIS TO MODIFY SERVER DETAILS OR SAVE THOSE DETAILS.

View file

@ -30,6 +30,7 @@ use Illuminate\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;
use Pterodactyl\Exceptions\DisplayException;
use Nicolaslopezj\Searchable\SearchableTrait;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Foundation\Auth\Access\Authorizable;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
@ -39,7 +40,7 @@ use Pterodactyl\Notifications\SendPasswordReset as ResetPasswordNotification;
class User extends Model implements AuthenticatableContract, AuthorizableContract, CanResetPasswordContract
{
use Authenticatable, Authorizable, CanResetPassword, Notifiable;
use Authenticatable, Authorizable, CanResetPassword, Notifiable, SearchableTrait;
/**
* The rules for user passwords.
@ -87,6 +88,16 @@ class User extends Model implements AuthenticatableContract, AuthorizableContrac
*/
protected $hidden = ['password', 'remember_token', 'totp_secret'];
protected $searchable = [
'columns' => [
'email' => 10,
'username' => 9,
'name_first' => 6,
'name_last' => 6,
'uuid' => 1,
],
];
/**
* Enables or disables TOTP on an account if the token is valid.
*