trafficmonitor/app/Forms/Auth/GoogleForm.php
2025-11-07 10:40:33 +09:00

39 lines
909 B
PHP

<?php
namespace App\Forms\Auth;
use App\Forms\CommonForm;
class GoogleForm extends CommonForm
{
public function __construct()
{
parent::__construct();
}
public function getFormFields(string $action, ?array $fields = null): array
{
return $fields ?? ["access_code"];
}
public function getFormFilters(string $action, ?array $fields = null): array
{
return $fields ?? [];
}
public function getBatchjobButtons(string $action = 'index', ?array $buttions = null): array
{
return $buttions ?? [];
}
public function getFormRule(string $action, string $field, array $rules = []): array
{
$rules = parent::getFormRule($action, $field, $rules);
switch ($field) {
case "access_code":
$rules[$field] = "required|trim|string";
default:
$rules = parent::getFormRule($action, $field, $rules);
break;
}
return $rules;
}
}