mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-19 06:43:45 +02:00
[L6] Break search functionality without breaking the entire app
This commit is contained in:
@@ -3,10 +3,11 @@
|
||||
namespace Pterodactyl\Models;
|
||||
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Pterodactyl\Models\Traits\Searchable;
|
||||
|
||||
class Node extends Validable
|
||||
{
|
||||
use Notifiable;
|
||||
use Notifiable, Searchable;
|
||||
|
||||
/**
|
||||
* The resource name for this model when it is transformed into an
|
||||
|
||||
@@ -2,8 +2,12 @@
|
||||
|
||||
namespace Pterodactyl\Models;
|
||||
|
||||
use Pterodactyl\Models\Traits\Searchable;
|
||||
|
||||
class Pack extends Validable
|
||||
{
|
||||
use Searchable;
|
||||
|
||||
/**
|
||||
* The resource name for this model when it is transformed into an
|
||||
* API representation using fractal.
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace Pterodactyl\Models;
|
||||
|
||||
use Schema;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Pterodactyl\Models\Traits\Searchable;
|
||||
use Znck\Eloquent\Traits\BelongsToThrough;
|
||||
|
||||
/**
|
||||
@@ -52,7 +53,7 @@ use Znck\Eloquent\Traits\BelongsToThrough;
|
||||
*/
|
||||
class Server extends Validable
|
||||
{
|
||||
use BelongsToThrough, Notifiable;
|
||||
use BelongsToThrough, Notifiable, Searchable;
|
||||
|
||||
/**
|
||||
* The resource name for this model when it is transformed into an
|
||||
|
||||
13
app/Models/Traits/Searchable.php
Normal file
13
app/Models/Traits/Searchable.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Models\Traits;
|
||||
|
||||
use Pterodactyl\Extensions\Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
trait Searchable
|
||||
{
|
||||
public function newEloquentBuilder($query)
|
||||
{
|
||||
return new Builder($query);
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ use Illuminate\Support\Collection;
|
||||
use Illuminate\Validation\Rules\In;
|
||||
use Illuminate\Auth\Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Pterodactyl\Models\Traits\Searchable;
|
||||
use Illuminate\Auth\Passwords\CanResetPassword;
|
||||
use Pterodactyl\Traits\Helpers\AvailableLanguages;
|
||||
use Illuminate\Foundation\Auth\Access\Authorizable;
|
||||
@@ -20,7 +21,7 @@ class User extends Validable implements
|
||||
AuthorizableContract,
|
||||
CanResetPasswordContract
|
||||
{
|
||||
use Authenticatable, Authorizable, AvailableLanguages, CanResetPassword, Notifiable;
|
||||
use Authenticatable, Authorizable, AvailableLanguages, CanResetPassword, Notifiable, Searchable;
|
||||
|
||||
const USER_LEVEL_USER = 0;
|
||||
const USER_LEVEL_ADMIN = 1;
|
||||
|
||||
Reference in New Issue
Block a user