1. The route of a requesting resource file is as follows: /static/xxx/9915995c-2952-4 90c-8e51-037a0950233c/assets/js/react.f886be.js
2. Since / is included in asset_key. Laravel routing components allow all characters except / . You must explicitly allow / to be part of a placeholder using the WHERE conditional regular expression. Otherwise, the route will fall back. The routes/web.php file is used to define routes to the web interface.
Route::get('/static/xxx/{theme_id}/{asset_key}', 'ModelController@show')->where('asset_key', '.*');
3. Openhttps://regex101.com/, to confirm that the regular expression .* can match assets/js/react.f886be.js. as shown in Figure 1

4. The method of the corresponding controller is implemented as follows. Because it needs to comply with the last-modified specification, use DATE_RFC7231, RFC 7231 format (example: SAT, 30 APR 2016) 17:52:13 GMT). as shown in Figure 2

$model = Model::where('theme_id', '=', $themeId)->where('asset_key', '=', $assetKey)->where('category', '=', Model::CATEGORY_ASSET)->firstOrFail();
return response($model->content, 200)
->withHeaders([
'Content-Type' => $model->mime_type,
'Last-Modified' => date(DATE_RFC7231, strtotime($model->getOriginal('updated_at'))),
]);
PHP / Laravel / Yii2 Legacy Project Maintenance & Long-Term Technical Support
If your PHP / Laravel / Yii2 project is already in production but needs bug fixing, API troubleshooting, performance optimization, developer handover support, or long-term maintenance, feel free to contact me for remote technical support.
Ideal For:
✅ PHP legacy systems without active maintenance
✅ Laravel / Yii2 project bug fixes
✅ Admin panel feature iterations
✅ RESTful API troubleshooting
✅ MySQL / Redis / Nginx performance issues
✅ Long-term remote part-time maintenance
We can start with a small task:
✅ Production error troubleshooting
✅ API issue analysis
✅ Slow query and performance bottleneck diagnosis
✅ Initial code structure review
✅ Deployment environment and log inspection
If you would like to discuss your project, please contact me and mention: PHP Maintenance Consultation.
Contact Me:
Telegram: @shuijingwan
WeChat: 13980074657
Email: shuijingwanwq@gmail.com

Leave a Reply