@if ($templates->count() > 0)
@if (Auth::user()->admin->can('update', $template)) @if ($template->categories()->count()) {{ $template->categories->map(function ($cat) { return $cat->name; })->join(', ') }} @else {{ trans('messages.template.category.no_category_set') }} @endif @else {{ $template->categories()->count() ? $template->categories->map(function ($cat) { return $cat->name; })->join(', ') : 'N/A' }} @endif