Allow more values for remote field when creating a database; closes #3842
This commit is contained in:
parent
b07fdc100c
commit
c751ce7f44
5 changed files with 22 additions and 10 deletions
|
@ -3,6 +3,7 @@
|
|||
namespace Pterodactyl\Models;
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Validation\Rule;
|
||||
use Illuminate\Container\Container;
|
||||
use Illuminate\Contracts\Validation\Factory;
|
||||
|
@ -111,6 +112,15 @@ abstract class Model extends IlluminateModel
|
|||
return $rules;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the rules for a specific field. If the field is not found an empty
|
||||
* array is returned.
|
||||
*/
|
||||
public static function getRulesForField(string $field): array
|
||||
{
|
||||
return Arr::get(static::getRules(), $field) ?? [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the rules associated with the model, specifically for updating the given model
|
||||
* rather than just creating it.
|
||||
|
|
Reference in a new issue