Download the PHP package amranibrahem/laravel-middleware-generator without Composer

On this page you can find all versions of the php package amranibrahem/laravel-middleware-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-middleware-generator

Laravel Middleware Generator

๐Ÿš€ Generate Custom Middleware Automatically with Professional Code Structure

A powerful Laravel package that automatically generates custom middleware with various authentication types, professional PHPDoc, and complete setup.

โœจ Features

๐Ÿš€ Installation

You can install the package via Composer:

The package will automatically register its service provider.

๐Ÿ“– Usage

Basic Commands Generate Role-Based Middleware

Generate with Specific Role

Generate Permission-Based Middleware

Generate with API Guard

Generate with Tests

Advanced Examples IP Whitelist Middleware

Header-Based Authentication

Subscription-Based Access

Boolean Field Check

Custom Error Message

๐ŸŽฏ Generated Code Examples

Role-Based Middleware

Permission-Based Middleware

IP-Based Middleware

โš™๏ธ Command Options

Option Description Default
--type Middleware type role
--role Role to check name lowercase
--permission Permission to check access.{name}
--subscription Subscription plan premium
--ip Allowed IPs 127.0.0.1,192.168.1.1
--header Header to check X-API-Key
--header-value Header value your-secret-key
--message Error message Type-based
--code HTTP status 403
--field User field role
--boolean Boolean field false
--model User model User
--guard Auth guard web
--test Generate test false

๐Ÿ›ฃ๏ธ Route Usage Examples

Static Role Check

Dynamic Role Check ` Permission-Based Routes

IP-Based Routes

๐Ÿงช Generated Test Example

๐ŸŽจ Console Output

๐Ÿ”ง Supported Middleware Types

1. Role-Based

2. Permission-Based

3. Subscription-Based

4. IP-Based

5. Header-Based

6. Custom

๐Ÿ›ก๏ธ Security Features

๐Ÿ”„ Auto-Generated Files

  1. Middleware File - app/Http/Middleware/{Name}Middleware.php
  2. Kernel Registration - Auto-added to app/Http/Kernel.php
  3. Auth Configuration - Updated config/auth.php for roles
  4. Route Examples - Added to routes/api.php or routes/web.php
  5. Test Files - Generated in tests/Unit/Middleware/

๐Ÿ’ก Best Practices

Use Boolean Fields for Single Roles

Custom HTTP Status Codes

API-Focused Middleware

Internal API Protection

๐Ÿ› Troubleshooting

Middleware not found in routes?

Authentication not working?

Tests failing?

๐Ÿš€ Comparison with Alternatives

Feature This Package Manual Creation
Time Saving โœ… (Seconds) โŒ (Minutes/Hours)
Professional Structure โœ… โŒ
Auto Registration โœ… โŒ
Route Examples โœ… โŒ
Test Generation โœ… โŒ
Multiple Types โœ… โŒ
Interactive Setup โœ… โŒ
Error Handling โœ… โŒ

๐Ÿ“ License

This package is open-sourced software licensed under the MIT license.

๐Ÿค Contributing

Please see CONTRIBUTING for details.

๐Ÿ› Reporting Issues

If you discover any issues, please use the GitHub issue tracker.

๐Ÿ† Credits

๐Ÿ”— Links


โญ Star us on GitHub if this package helped you!

๐Ÿš€ Happy coding!


All versions of laravel-middleware-generator with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
laravel/framework Version ^9.0|^10.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package amranibrahem/laravel-middleware-generator contains the following files

Loading the files please wait ...