Push subuser creation service
This commit is contained in:
parent
2a5570877c
commit
74ea1aa0aa
23 changed files with 1077 additions and 229 deletions
|
@ -25,9 +25,13 @@
|
|||
namespace Pterodactyl\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Sofa\Eloquence\Contracts\CleansAttributes;
|
||||
use Sofa\Eloquence\Eloquence;
|
||||
|
||||
class Permission extends Model
|
||||
class Permission extends Model implements CleansAttributes
|
||||
{
|
||||
use Eloquence;
|
||||
|
||||
/**
|
||||
* Should timestamps be used on this model.
|
||||
*
|
||||
|
@ -118,12 +122,12 @@ class Permission extends Model
|
|||
/**
|
||||
* Return a collection of permissions available.
|
||||
*
|
||||
* @param array $single
|
||||
* @return \Illuminate\Support\Collection|array
|
||||
* @param bool $array
|
||||
* @return array|\Illuminate\Support\Collection
|
||||
*/
|
||||
public static function listPermissions($single = false)
|
||||
public static function getPermissions($array = false)
|
||||
{
|
||||
if ($single) {
|
||||
if ($array) {
|
||||
return collect(self::$permissions)->mapWithKeys(function ($item) {
|
||||
return $item;
|
||||
})->all();
|
||||
|
|
|
@ -26,10 +26,14 @@ namespace Pterodactyl\Models;
|
|||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Sofa\Eloquence\Contracts\CleansAttributes;
|
||||
use Sofa\Eloquence\Contracts\Validable as ValidableContract;
|
||||
use Sofa\Eloquence\Eloquence;
|
||||
use Sofa\Eloquence\Validable;
|
||||
|
||||
class Subuser extends Model
|
||||
class Subuser extends Model implements CleansAttributes, ValidableContract
|
||||
{
|
||||
use Notifiable;
|
||||
use Eloquence, Notifiable, Validable;
|
||||
|
||||
/**
|
||||
* The table associated with the model.
|
||||
|
@ -62,6 +66,24 @@ class Subuser extends Model
|
|||
'server_id' => 'integer',
|
||||
];
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected static $applicationRules = [
|
||||
'user_id' => 'required',
|
||||
'server_id' => 'required',
|
||||
'daemonSecret' => 'required',
|
||||
];
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected static $dataIntegrityRules = [
|
||||
'user_id' => 'numeric|exists:users,id',
|
||||
'server_id' => 'numeric|exists:servers,id',
|
||||
'daemonSecret' => 'string',
|
||||
];
|
||||
|
||||
/**
|
||||
* Gets the server associated with a subuser.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue