PHPackages                             srdev93/laravel-guardian - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. srdev93/laravel-guardian

ActiveLibrary[Security](/categories/security)

srdev93/laravel-guardian
========================

Laravel Guardian - Security &amp; Performance Suite for Laravel.

1.0.0(6mo ago)03MITPHPPHP ^8.1|^8.2|^8.3|^8.4

Since Oct 23Pushed 6mo agoCompare

[ Source](https://github.com/SrDev93/laravel-guardian)[ Packagist](https://packagist.org/packages/srdev93/laravel-guardian)[ RSS](/packages/srdev93-laravel-guardian/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

🛡️ Laravel Guardian
===================

[](#️-laravel-guardian)

**Laravel Guardian** is an all-in-one package for enhancing the security and performance of Laravel applications.
This package automatically scans your application for security and performance issues, generates reports, and even resolves some issues automatically.

---

🚀 Features
----------

[](#-features)

### 🔒 Security Module

[](#-security-module)

- Checks the permissions of sensitive files and directories (`.env`, `storage`, `bootstrap/cache`)
- Detects insecure file permissions (e.g., 777, 775)
- Scans for dangerous files like `phpinfo.php`, `.git`, `composer.lock`
- Validates CSRF protection, APP\_KEY, and Debug Mode settings
- Option to automatically remove unsafe files with artisan commands

### ⚡ Performance Module

[](#-performance-module)

- Analyzes slow database queries from logs
- Detects large or inefficient Blade views (e.g., excessive loops or includes)
- Recommends enabling caching where appropriate
- Checks for the usage of `eager loading` in models
- Provides an automatic optimization command: ```
    php artisan guardian:optimize

    ```

### 📊 Monitoring &amp; Notification Module

[](#-monitoring--notification-module)

- Monitors Laravel logs for new errors and sends alerts (via Telegram, Email, etc.)
- Saves logs in `storage/logs/guardian.log`
- Sends alerts about detected issues in real-time
- Supports sending alerts via Telegram and Email
- Can be run continuously with `guardian:watch` command to monitor logs and notify in real-time

---

🧩 Installation
--------------

[](#-installation)

Install the package via Composer:

```
composer require srdev93/laravel-guardian

```

To publish the configuration file:

```
php artisan vendor:publish --tag=guardian-config

```

---

⚙️ Configuration
----------------

[](#️-configuration)

Once installed, the configuration file will be available at:

`config/guardian.php`

Example config:

```
return [
    'check_security' => true,
    'check_performance' => true,
    'auto_fix' => false,
    'telegram_bot_token' => env('GUARDIAN_TELEGRAM_BOT_TOKEN', null),
    'telegram_chat_id' => env('GUARDIAN_TELEGRAM_CHAT_ID', null),
];

```

You can enable or disable different modules based on your needs (e.g., security, performance).

---

🧠 Artisan Commands
------------------

[](#-artisan-commands)

CommandDescription`php artisan guardian:scan-security`Scan for security and performance issues in the application.`php artisan guardian:optimize`Automatically optimize the application by clearing caches, optimizing routes, views, and configs.`php artisan guardian:report`Generate a report of security and performance status in either JSON or HTML format.`php artisan guardian:watch`Continuously monitor Laravel logs for new errors and send notifications.---

📄 Example Report Output
-----------------------

[](#-example-report-output)

After running the `guardian:report` command, the generated report will show results similar to this:

```
Guardian Report
========================
✅ Secure: No issues found.
⚠️ Performance: 3 potential slow queries detected.

```

In HTML format, it will look like this:

```
Guardian Report
Security

  No issues found.

Performance

  3 slow queries detected (>200ms)

```

---

🛠 Future Development
--------------------

[](#-future-development)

- Web dashboard to view security and performance reports
- Integration with Reverb for live monitoring and real-time alerts
- Support for email notifications
- Periodic report generation (daily, weekly)

---

🤝 Contributing
--------------

[](#-contributing)

We welcome contributions! If you have ideas for enhancing Laravel Guardian, feel free to submit a Pull Request or open an Issue.

---

🪪 License
---------

[](#-license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

---

**Developed with ❤️ by [SrDev93](https://github.com/SrDev93)**

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance66

Regular maintenance activity

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

201d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d7c0a93b7b72abd761ae9d8b703dac751ed1b56e0fadd331848d78214e4d7d32?d=identicon)[SrDev93](/maintainers/SrDev93)

---

Top Contributors

[![SrDev93](https://avatars.githubusercontent.com/u/38728381?v=4)](https://github.com/SrDev93 "SrDev93 (1 commits)")

### Embed Badge

![Health badge](/badges/srdev93-laravel-guardian/health.svg)

```
[![Health](https://phpackages.com/badges/srdev93-laravel-guardian/health.svg)](https://phpackages.com/packages/srdev93-laravel-guardian)
```

###  Alternatives

[illuminate/encryption

The Illuminate Encryption package.

9229.7M280](/packages/illuminate-encryption)[tzsk/otp

A secure, database-free One-Time Password (OTP) generator and verifier for PHP and Laravel.

241641.4k1](/packages/tzsk-otp)[genealabs/laravel-governor

Managing policy and control in Laravel.

201262.8k](/packages/genealabs-laravel-governor)[dgtlss/warden

A Laravel package that proactively monitors your dependencies for security vulnerabilities by running automated composer audits and sending notifications via webhooks and email

8745.6k](/packages/dgtlss-warden)[ercsctt/laravel-file-encryption

Secure file encryption and decryption for Laravel applications

642.6k](/packages/ercsctt-laravel-file-encryption)[laragear/poke

Keep your forms alive, avoid TokenMismatchException by gently poking your Laravel app

2211.5k](/packages/laragear-poke)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
