Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
gheorghelupu17 committed Aug 3, 2023
2 parents a78ee9c + 5ad23d3 commit 7b3e424
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
3 changes: 3 additions & 0 deletions app/Http/Controllers/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ public function ngosPage(Request $request)
public function ngoPage(string $local, string $slug)
{
$ngo = Ngo::query()->where('slug', $slug)->with(['city', 'county'])->firstOrFail();



$breadcrumbs =
[
[
Expand Down
5 changes: 5 additions & 0 deletions app/Models/Ngo.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,9 @@ public function getActivityDomainsNameAttribute(): \Illuminate\Support\Collectio
{
return ActivityDomain::whereIn('id', $this->activity_domains)->pluck('name', 'id');
}
public function getInterventionDomainsNameAttribute(): \Illuminate\Support\Collection
{

return $this->services()->with('interventionDomain')->get()->pluck('interventionDomain')->flatten()->pluck('name', 'id');
}
}
15 changes: 5 additions & 10 deletions resources/views/ngos_index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,15 @@ class="my-2 mt-3 h-12 flex justify-center text-center items-center w-full bg-o
</p>
<p class="font-bold">{{ __('txt.ngo_card.intervention_domains') }}
@php $tmpDomains = []; @endphp
@foreach($ngo->services as $service)
@foreach($service->interventionDomain as $domain)
@if(!in_array($domain->id,$tmpDomains))
@php $tmpDomains[] = $domain->id;
@endphp
@foreach($ngo->intervention_domains_name as $domain)
<span class="text-orange1">
{{ $domain->name }}
</span>
@endif
@endforeach
{{$domain}}
</span>
@if(!$loop->last)
,
@endif
@endforeach
@endforeach


</p>
<p class="font-bold">{{ __('txt.ngo_card.beneficiaries_nr') }} <span
Expand Down

0 comments on commit 7b3e424

Please sign in to comment.