m-derakhshi/laravel-php-security
Composer 安装命令:
composer require m-derakhshi/laravel-php-security
包简介
A package for checking PHP security settings in Laravel
README 文档
README
This package helps you quickly assess and improve the security settings of your PHP environment within a Laravel application. It checks essential security configurations and provides recommendations to enhance security by adjusting your php.ini file.
Installation
Step 1: Install the Package
To include this package in your Laravel project:
composer require m-derakhshi/laravel-php-security
Step 2: Publish the Views (Optional)
To customize the view template, publish the package views:
php artisan vendor:publish --tag=views --provider="MDerakhshi\SecurityCheck\LaravelPHPSecurityServiceProvider"
Usage
Route and Controller
- Create a route and controller action for the security check. For example, you might use a
SecurityCheckController:
// In web.php Route::get('/security-check', [SecurityCheckController::class, 'index']);
- Create the controller to handle the package:
<?php namespace App\Http\Controllers; use MDerakhshi\SecurityCheck\LaravelPHPSecurityCheck; class SecurityCheckController extends Controller { public function index(LaravelPHPSecurityCheck $securityCheck) { $result = $securityCheck->checkSettings(); return view('laravel-php-security-check::laravel-php-security-check', $result); } }
Displaying the Security Check
Visit /security-check in your Laravel application to view the PHP security settings and recommended adjustments.
Features
- PHP Extensions Check: Confirms essential extensions (like GD, intl, mbstring, etc.) are enabled.
- Security Settings Check: Validates critical PHP settings such as
register_argc_argv,display_errors,expose_php, and more. - Recommended php.ini Adjustments: Displays suggestions for modifying
php.inisettings to enhance security.
Customization
After publishing, the view files are located in resources/views/vendor/laravel-php-security-check/ and can be modified to adjust the display as needed.
License
This package is open-source software licensed under the MIT license.
m-derakhshi/laravel-php-security 适用场景与选型建议
m-derakhshi/laravel-php-security 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 230 次下载、GitHub Stars 达 3, 最近一次更新时间为 2024 年 11 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 m-derakhshi/laravel-php-security 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 m-derakhshi/laravel-php-security 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 230
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-11-14

