File: /home/xedaptot/be.naniguide.com/app/Library/GeneralTagResolver.php
<?php
namespace App\Library;
use App\Library\Contracts\TagResolverInterface;
use Carbon\Carbon;
/**
* Stateless resolver for app-wide, time-based tags
* available in every email/subject/plain pipeline:
*
* {{ CURRENT_YEAR }}, {{ current_date }}, {{ CURRENT_DATETIME }}, ...
*
* Keys are returned lowercase; TagTranslationService::duplicateUppercaseKeys()
* auto-generates the UPPER variants, so both casings work in templates.
*/
class GeneralTagResolver implements TagResolverInterface
{
public function getResolvedTags(): array
{
$now = Carbon::now();
return [
'current_year' => $now->format('Y'),
'current_month' => $now->format('m'),
'current_month_name' => $now->format('F'),
'current_day' => $now->format('d'),
'current_weekday' => $now->format('l'),
'current_date' => $now->format('Y-m-d'),
'current_time' => $now->format('H:i:s'),
'current_datetime' => $now->format('Y-m-d H:i:s'),
];
}
}