Skip to content

Commit

Permalink
Added click count to link info page
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianPrieber committed Oct 19, 2023
1 parent 4e08fed commit 64b61e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/Http/Controllers/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,7 @@ public function redirectInfo(request $request)
}

$linkData = Link::find($linkId);
$clicks = $linkData->click_number;

if (empty($linkData)) {
return abort(404);
Expand All @@ -749,7 +750,7 @@ function isValidLink($url) {
$userID = $linkData->user_id;
$userData = User::find($userID);

return view('linkinfo', ['linkID' => $linkId, 'link' => $link, 'id' => $userID, 'userData' => $userData]);
return view('linkinfo', ['clicks' => $clicks, 'linkID' => $linkId, 'link' => $link, 'id' => $userID, 'userData' => $userData]);

}

Expand Down
3 changes: 2 additions & 1 deletion resources/views/linkinfo.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@
{{__('messages.Email')}}: {{$userData->email}}
{{__('messages.Role')}}: {{$userData->role}}
{{__('messages.Created at')}}: {{$userData->created_at}}
{{__('messages.Last seen')}}: {{$userData->updated_at}}</code>
{{__('messages.Last seen')}}: {{$userData->updated_at}}
{{__('messages.Link Clicks:')}} {{$clicks}}</code>
</pre>
</div>
</div>
Expand Down

0 comments on commit 64b61e6

Please sign in to comment.