Initial Commit

The initial public commit of MVGL website code.
This commit is contained in:
Jimmy B. 2024-01-14 13:51:43 -06:00
commit b39ecf1638
2043 changed files with 215154 additions and 0 deletions

View file

@ -0,0 +1,32 @@
<?php
namespace App\Rules;
use Illuminate\Contracts\Validation\InvokableRule;
use Illuminate\Support\Carbon;
class GameReleaseDate implements InvokableRule
{
/**
* Run the validation rule.
*
* @param string $attribute
* @param mixed $value
* @param \Closure(string): \Illuminate\Translation\PotentiallyTranslatedString $fail
* @return void
*/
public function __invoke($attribute, $value, $fail)
{
if ($value === 'TBD' || $value === 'EA') {
return true;
}
try {
Carbon::createFromFormat('F j, Y', $value);
} catch (\Exception $e) {
$fail('The release date must be in the format of Month Day, Year (ex. March 10, 2000), TBD or EA.');
}
return true;
}
}