auditionadmin/app/helpers.php

45 lines
962 B
PHP

<?php
use App\Actions\Tabulation\EnterScore;
use App\Exceptions\ScoreEntryException;
use App\Models\Entry;
use App\Models\User;
use App\Settings;
function tw_max_width_class_array(): array
{
$return = [
'xs' => 'max-w-xs',
'sm' => 'max-w-sm',
'md' => 'max-w-md',
'lg' => 'max-w-lg',
'xl' => 'max-w-xl',
'2xl' => 'max-w-2xl',
'3xl' => 'max-w-3xl',
'4xl' => 'max-w-4xl',
'5xl' => 'max-w-5xl',
'6xl' => 'max-w-6xl',
'7xl' => 'max-w-7xl',
'full' => 'max-w-full',
'fit' => 'max-w-fit',
'min' => 'max-w-min',
'max' => 'max-w-max',
];
return $return;
}
function auditionSetting($key)
{
return Settings::get($key);
}
/**
* @throws ScoreEntryException
*/
function enterScore(User $user, Entry $entry, array $scores): \App\Models\ScoreSheet
{
$scoreEntry = new EnterScore();
return $scoreEntry($user, $entry, $scores);
}