Skip to content

Commit

Permalink
Services(count(sermons) added to sermons page
Browse files Browse the repository at this point in the history
  • Loading branch information
Ndaboom committed Apr 23, 2022
1 parent a823e0c commit d1a794b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
4 changes: 2 additions & 2 deletions resources/views/auth/login.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@

<div class="text-center w-75 m-auto">
<div class="auth-logo">
<a href="index.html" class="logo logo-dark text-center">
<a href="{{ route('home') }}" class="logo logo-dark text-center">
<span class="logo-lg">
<img src="{{ asset('assets/login/images/logo-dark.png') }}" alt="" height="22">
</span>
</a>
<a href="index.html" class="logo logo-light text-center">
<a href="{{ route('home') }}" class="logo logo-light text-center">
<span class="logo-lg">
<img src="{{ asset('assets/login/images/logo-light.png') }}" alt="" height="22">
</span>
Expand Down
12 changes: 3 additions & 9 deletions resources/views/sermons.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,9 @@
</div>

<ul>

<li><a href="">Faith</a> (10)</li>

<li><a href="#">Missions</a> (12)</li>

<li><a href="#">Salvation</a> (34)</li>

<li><a href="#">Worship</a> (14)</li>

@foreach ($services as $item)
<li><a href="{{ route('sermons_by', ['id'=> $item['id']]) }}">{{ $item['service_name'] }}</a> ({{ count($item['sermons']) }})</li>
@endforeach
</ul>

</div>
Expand Down
14 changes: 12 additions & 2 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,18 @@
if ($response->successful()) {
$preachers = $response['data'];
}
// dd($response->json());
return view('sermons', ['sermons' => $sermons, 'preachers' => $preachers, 'pagination' => $pagination]);

$url = config('app.api_path') . 'services/all';
$services = [];
$response = Http::timeout(200)
->withHeaders(['X-Requested-With' => 'XMLHttpRequest'])
->get($url);

if ($response->successful()) {
$services = $response['data'];
}

return view('sermons', ['sermons' => $sermons, 'preachers' => $preachers, 'pagination' => $pagination, 'services' => $services]);
})->name('sermons');


Expand Down

0 comments on commit d1a794b

Please sign in to comment.