-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2627 from RaiderIO/development
Release v11.7.2 - Map menu layout improvements on mobile
- Loading branch information
Showing
36 changed files
with
748 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
namespace App\Http\Middleware; | ||
|
||
use App\Models\User; | ||
use App\Models\UserIpAddress; | ||
use Auth; | ||
use Closure; | ||
use Illuminate\Http\Request; | ||
use Illuminate\Support\Facades\DB; | ||
use Symfony\Component\HttpFoundation\Response; | ||
|
||
class TracksUserIpAddress | ||
{ | ||
/** | ||
* Handle an incoming request. | ||
*/ | ||
public function handle(Request $request, Closure $next): Response | ||
{ | ||
// Maybe this should be handled differently? Idk how heavy these queries will be | ||
if (!$request->ajax() && Auth::check()) { | ||
/** @var User $user */ | ||
$user = Auth::user(); | ||
UserIpAddress::upsert( | ||
[ | ||
'user_id' => $user->id, | ||
'ip_address' => $request->ip(), | ||
'count' => 1, // Default value for new rows | ||
'updated_at' => now(), // Example of tracking when a row is updated | ||
], | ||
['user_id', 'ip_address'], | ||
['count' => DB::raw('count + 1'), 'updated_at'] // Update these columns if a conflict occurs | ||
); | ||
} | ||
|
||
return $next($request); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
namespace App\Models; | ||
|
||
use Eloquent; | ||
use Illuminate\Database\Eloquent\Model; | ||
use Illuminate\Database\Eloquent\Relations\BelongsTo; | ||
use Illuminate\Support\Carbon; | ||
|
||
/** | ||
* @property int $id | ||
* @property int $user_id | ||
* @property string $ip_address | ||
* @property int $count | ||
* | ||
* @property Carbon $updated_at | ||
* @property Carbon $created_at | ||
* | ||
* @property User $user | ||
* | ||
* @mixin Eloquent | ||
*/ | ||
class UserIpAddress extends Model | ||
{ | ||
protected $fillable = [ | ||
'user_id', | ||
'ip_address', | ||
'count', | ||
'updated_at', | ||
'created_at', | ||
]; | ||
|
||
public function user(): BelongsTo | ||
{ | ||
return $this->belongsTo(User::class, 'user_id'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace App\Overrides; | ||
|
||
use Illuminate\Cache\RateLimiter as BaseRateLimiter; | ||
|
||
class CustomRateLimiter extends BaseRateLimiter | ||
{ | ||
public function __construct($cache) | ||
{ | ||
parent::__construct($cache); | ||
} | ||
|
||
public function cleanRateLimiterKey($key): string | ||
{ | ||
// Add a custom prefix specifically for rate limiter keys | ||
$prefix = 'rate-limiter:'; | ||
|
||
return $prefix . parent::cleanRateLimiterKey($key); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.