Update admin location routes and controller to use service
Needs tests written, uses new validation on model.
This commit is contained in:
parent
26e476a794
commit
fe4977f0fa
7 changed files with 293 additions and 60 deletions
|
@ -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.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue