|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
function generateUrlWithPath(string $urlKey, string $pathKey, string $defaultUrl, string $defaultPath): string |
|
4
|
|
|
{ |
|
5
|
|
|
$url = env($urlKey, $defaultUrl); |
|
6
|
|
|
$path = env($pathKey, $defaultPath); |
|
7
|
|
|
|
|
8
|
|
|
return $path ? "{$url}/{$path}" : $url; |
|
|
|
|
|
|
9
|
|
|
} |
|
10
|
|
|
|
|
11
|
|
|
return [ |
|
12
|
|
|
'name' => 'BlogCore', |
|
13
|
|
|
|
|
14
|
|
|
'fe_path' => env('BLOG_FE_PATH', 'blog'), |
|
15
|
|
|
'fe_url' => env('BLOG_FE_URL', 'https://cslant.com'), |
|
16
|
|
|
'fe_url_with_path' => generateUrlWithPath('BLOG_FE_URL', 'BLOG_FE_PATH', 'https://cslant.com', 'blog'), |
|
17
|
|
|
|
|
18
|
|
|
'admin_path' => env('BLOG_ADMIN_PATH', 'admin/blog'), |
|
19
|
|
|
'admin_url' => env('BLOG_ADMIN_URL', 'https://cslant.com'), |
|
20
|
|
|
'admin_url_with_path' => generateUrlWithPath('BLOG_ADMIN_URL', 'BLOG_ADMIN_PATH', 'https://cslant.com', 'admin/blog'), |
|
21
|
|
|
|
|
22
|
|
|
'api_path' => env('BLOG_API_PATH', 'api/blog'), |
|
23
|
|
|
'api_url' => env('BLOG_API_URL', 'https://cslant.com'), |
|
24
|
|
|
'api_url_with_path' => generateUrlWithPath('BLOG_API_URL', 'BLOG_API_PATH', 'https://cslant.com', 'api/blog'), |
|
25
|
|
|
|
|
26
|
|
|
'laravel_domain' => env('LARAVEL_BLOG_DOMAIN', 'no-accept-domain'), |
|
27
|
|
|
|
|
28
|
|
|
'view_throttle_minutes' => env('BLOG_VIEW_THROTTLE_MINUTES', 60), |
|
29
|
|
|
|
|
30
|
|
|
'blog_api_default_rate_limit' => env('BLOG_API_DEFAULT_RATE_LIMIT', 50), |
|
31
|
|
|
]; |
|
32
|
|
|
|