mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-15 12:53:44 +02:00
Update admin location routes and controller to use service
Needs tests written, uses new validation on model.
This commit is contained in:
@@ -25,9 +25,12 @@
|
||||
namespace Pterodactyl\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Watson\Validating\ValidatingTrait;
|
||||
|
||||
class Location extends Model
|
||||
{
|
||||
use ValidatingTrait;
|
||||
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*
|
||||
@@ -42,6 +45,16 @@ class Location extends Model
|
||||
*/
|
||||
protected $guarded = ['id', 'created_at', 'updated_at'];
|
||||
|
||||
/**
|
||||
* Validation rules to apply when attempting to save a model to the DB.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $rules = [
|
||||
'short' => 'required|string|between:1,60|unique:locations,short',
|
||||
'long' => 'required|string|between:1,255',
|
||||
];
|
||||
|
||||
/**
|
||||
* Gets the nodes in a specificed location.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user