Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F120836084
RouteServiceProvider.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
RouteServiceProvider.php
View Options
<?php
namespace
App\Providers
;
use
Illuminate\Cache\RateLimiting\Limit
;
use
Illuminate\Foundation\Support\Providers\RouteServiceProvider
as
ServiceProvider
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\RateLimiter
;
use
Illuminate\Support\Facades\Route
;
class
RouteServiceProvider
extends
ServiceProvider
{
/**
* Define your route model bindings, pattern filters, etc.
*/
public
function
boot
():
void
{
$this
->
configureRateLimiting
();
$this
->
routes
(
static
function
()
{
$prefix
=
\trim
(
\parse_url
(
\config
(
'app.url'
),
\PHP_URL_PATH
),
'/'
)
.
'/'
;
Route
::
prefix
(
$prefix
.
'api'
)
->
group
(
base_path
(
'routes/api.php'
));
Route
::
middleware
(
'web'
)
->
group
(
base_path
(
'routes/web.php'
));
});
}
/**
* Configure the rate limiters for the application.
*/
protected
function
configureRateLimiting
():
void
{
RateLimiter
::
for
(
'api'
,
static
function
(
Request
$request
)
{
return
Limit
::
perMinute
(
60
)->
by
(
$request
->
user
()?->
id
?:
$request
->
ip
());
});
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Apr 24, 1:26 PM (1 d, 1 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18824088
Default Alt Text
RouteServiceProvider.php (1 KB)
Attached To
Mode
rK kolab
Attached
Detach File
Event Timeline