[9.x] Use php 8 null safe operator (#5670)
This PR leverages php 8 "null safe operator" instead of thrr `optional()` helper
This commit is contained in:
parent
d57cc57c6d
commit
5f9dbb41b5
|
@ -57,7 +57,7 @@ public function boot()
|
||||||
protected function configureRateLimiting()
|
protected function configureRateLimiting()
|
||||||
{
|
{
|
||||||
RateLimiter::for('api', function (Request $request) {
|
RateLimiter::for('api', function (Request $request) {
|
||||||
return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());
|
return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue