<?php

use App\Core\Url;

if (!function_exists('url')) {
  function url(string $key, array $params = []): string
  {
    return Url::path($key, $params);
  }
}

if (!function_exists('asset')) {
  function asset(string $path): string
  {
    return Url::asset($path);
  }
}

if (!function_exists('redirect')) {
  function redirect(string $key, array $params = [], ?string $hash = null): never
  {
    Url::redirect($key, $params, $hash);
  }
}

if (!function_exists('upload')) {
  function upload(string $folder, string $filename): string
  {
    return Url::uploads(trim($folder, '/') . '/' . ltrim($filename, '/'));
  }
}

if (!function_exists('ticket_upload')) {
  function ticket_upload(string $filename): string
  {
    return upload('tickets', $filename);
  }
}
