Skip to content

Commit

Permalink
Remove the question mark at the end of the URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
niladam committed Sep 5, 2023
1 parent 8ccce68 commit c8f3450
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/helpers.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


use Illuminate\Database\Eloquent\Model;
use Jenssegers\Agent\Facades\Agent;
use Niladam\LaravelVisits\Concerns\CanHaveVisits;
Expand All @@ -18,6 +17,7 @@ function visitUrl(
$record['url'] = str($url)
->when(config('laravel-visits.remove_current_app_domain'), fn ($str) => $str->replace(search: config('app.url'), replace: ''))
->when(! empty(config('laravel-visits.replace_in_urls')), fn ($str) => $str->replace(search: config('laravel-visits.replace_in_urls'), replace: ''))
->replaceLast(search: '?', replace: '')
->toString();

$job = config('laravel-visits.overwrites.job_url', RecordVisitUrlJob::class);
Expand Down Expand Up @@ -62,7 +62,7 @@ function visitModel(

if (! function_exists('visit')) {
function visit(
CanHaveVisits | string $visitable,
CanHaveVisits|string $visitable,
int $count = 1,
string $referer = null,
string $platform = null,
Expand Down Expand Up @@ -96,8 +96,8 @@ function visit(
}

if (! function_exists('recordVisit')) {
function recordVisit(CanHaveVisits | string $visitable)
function recordVisit(CanHaveVisits|string $visitable)
{
return visit($visitable);
}
}
}

0 comments on commit c8f3450

Please sign in to comment.