2020-08-18 16:31:28 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @copyright 2020 Podlibre
|
|
|
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
|
|
|
* @link https://castopod.org/
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace App\Validation;
|
|
|
|
|
|
|
|
class Rules
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Value should not be within the array of protected slugs (adminGateway, authGateway or installGateway)
|
|
|
|
*
|
|
|
|
* @param string $value
|
|
|
|
*
|
|
|
|
* @return boolean
|
|
|
|
*/
|
|
|
|
public function not_in_protected_slugs(string $value = null): bool
|
|
|
|
{
|
|
|
|
$appConfig = config('App');
|
|
|
|
$protectedSlugs = [
|
|
|
|
$appConfig->adminGateway,
|
|
|
|
$appConfig->authGateway,
|
|
|
|
$appConfig->installGateway,
|
|
|
|
];
|
|
|
|
return !in_array($value, $protectedSlugs, true);
|
|
|
|
}
|
2020-09-08 11:45:17 +00:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2020-08-18 16:31:28 +00:00
|
|
|
}
|