backend validation change, frontend changes
Build / Build-image (push) Successful in 53s

This commit is contained in:
2026-08-10 20:39:56 +02:00
parent 48048e516a
commit f84636b31f
7 changed files with 116 additions and 26 deletions
+19
View File
@@ -12,4 +12,23 @@ class Tla extends Model
use HasFactory;
protected $fillable = ['abbreviation', 'hint', 'used'];
public static function GetCurrentTla( string $language ) : Tla {
$tla = Tla::where('used', date("Y-m-d"))
->where('language', $language)
->first();
if ( is_null($tla) ) {
$tla = Tla::where('language', $language)
->where('used', NULL)
->inRandomOrder()
->first();
$tla->used = date("Y-m-d");
$tla->save();
}
return $tla;
}
}