Skip to content

Commit

Permalink
adding the pageviews in the respective place #56
Browse files Browse the repository at this point in the history
  • Loading branch information
abidulrmdn committed Mar 9, 2017
1 parent c638812 commit fbf0ab6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
4 changes: 4 additions & 0 deletions y2bsearch/app/Http/Middleware/PageViewsCounter.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ public function handle($request, Closure $next, $guard = null)
fwrite($f, $counterVal);
fclose($f);

view()->share(
'pageViews', $counterVal
);

return $next($request);
}

Expand Down
19 changes: 12 additions & 7 deletions y2bsearch/resources/views/subviews/header.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@
<img class="logo" src="{{asset('images/logo.png')}}">
</div>
@if($showSearch)
<form method="GET" action="/" class="header item">
<div class="ui action input">
<input type="search" name="search" placeholder="Search...">
<button class="ui icon button">
<i class="search icon"></i>
</button>
<form method="GET" action="/" class="header item">
<div class="ui action input">
<input type="search" name="search" placeholder="Search...">
<button class="ui icon button">
<i class="search icon"></i>
</button>
</div>
</form>
@else
<div style="float: right;position: absolute;right: 1vh;top: 1.6vh;color: white;font-size: 1.3em;">
<i class="users icon"></i>
<span>{{$pageViews}}</span>
</div>
</form>
@endif
</div>
</div>

0 comments on commit fbf0ab6

Please sign in to comment.