Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Illuminate\Support\ServiceProvider;
use Illuminate\Validation\Rules\Password;
use Laravel\Sanctum\Sanctum;
use Spatie\Translatable\Facades\Translatable;

class AppServiceProvider extends ServiceProvider
{
Expand All @@ -34,6 +35,10 @@ public function boot(): void
$this->definingDefaultPasswordRules();

Sanctum::usePersonalAccessTokenModel(PersonalAccessToken::class);

Translatable::fallback(
fallbackAny: true,
);
}

/**
Expand Down
21 changes: 3 additions & 18 deletions resources/views/portal/livewire/stats/recipe-stats.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,15 +208,10 @@
</flux:table.columns>
<flux:table.rows>
@foreach($this->topIngredients as $ingredient)
@php
$locales = json_decode($ingredient->country_locales ?? '["en"]', true);
$names = is_string($ingredient->name) ? json_decode($ingredient->name, true) : $ingredient->name;
$ingredientName = $names[$locales[0] ?? 'en'] ?? (is_array($names) ? array_values($names)[0] ?? '' : '');
@endphp
<flux:table.row wire:key="ingredient-{{ $loop->index }}">
<flux:table.cell class="truncate max-w-48">
<x-flag :code="$ingredient->country_code" :title="$ingredient->country_code" />
{{ $ingredientName }}
{{ $ingredient->name }}
</flux:table.cell>
<flux:table.cell align="end" class="tabular-nums">{{ Number::format($ingredient->recipes_count) }}</flux:table.cell>
</flux:table.row>
Expand All @@ -234,15 +229,10 @@
</flux:table.columns>
<flux:table.rows>
@foreach($this->topTags as $tag)
@php
$locales = json_decode($tag->country_locales ?? '["en"]', true);
$names = is_string($tag->name) ? json_decode($tag->name, true) : $tag->name;
$tagName = $names[$locales[0] ?? 'en'] ?? (is_array($names) ? array_values($names)[0] ?? '' : '');
@endphp
<flux:table.row wire:key="tag-{{ $loop->index }}">
<flux:table.cell class="truncate max-w-48">
<x-flag :code="$tag->country_code" :title="$tag->country_code" />
{{ $tagName }}
{{ $tag->name }}
</flux:table.cell>
<flux:table.cell align="end" class="tabular-nums">{{ Number::format($tag->recipes_count) }}</flux:table.cell>
</flux:table.row>
Expand All @@ -260,15 +250,10 @@
</flux:table.columns>
<flux:table.rows>
@foreach($this->topCuisines as $cuisine)
@php
$locales = json_decode($cuisine->country_locales ?? '["en"]', true);
$names = is_string($cuisine->name) ? json_decode($cuisine->name, true) : $cuisine->name;
$cuisineName = $names[$locales[0] ?? 'en'] ?? (is_array($names) ? array_values($names)[0] ?? '' : '');
@endphp
<flux:table.row wire:key="cuisine-{{ $loop->index }}">
<flux:table.cell class="truncate max-w-48">
<x-flag :code="$cuisine->country_code" :title="$cuisine->country_code" />
{{ $cuisineName }}
{{ $cuisine->name }}
</flux:table.cell>
<flux:table.cell align="end" class="tabular-nums">{{ Number::format($cuisine->recipes_count) }}</flux:table.cell>
</flux:table.row>
Expand Down