Provides generators, helpers, and utilities for rapid prototyping of Slytherin-based applications.
Weasley is a PHP package that provides generators, helpers, and utilities for rapid prototyping of Slytherin-based applications. Might be useful for developing Slytherin-based applications with a time constraint.
Install Weasley
via Composer:
$ composer require rougin/weasley
Access the generator commands through vendor/bin/weasley
in the terminal/command line. To know the more the arguments and options, include the option --help
to the chosen command.
Command | Description |
---|---|
make:controller | Creates a new HTTP controller class |
make:integration | Creates a new Slytherin Integration class |
make:middleware | Creates a new v0.4.1 of PSR-15 middleware class |
make:validator | Creates a new validator class based on Valitron |
Controller | Description |
---|---|
JsonController | Provides methods for RESTful APIs in JSON format |
Integration | Description |
---|---|
SessionIntegration | An implementation of SessionHandlerInterface |
Integration | Description |
---|---|
DatabaseIntegration | Based on illuminate/database (Eloquent) |
PaginationIntegration | Based on illuminate/pagination |
ViewIntegration | Based on illuminate/view (Blade) |
NOTE: The mentioned integrations above needs to include their required dependencies first.
Middleware | Description |
---|---|
CrossOriginHeaders | Adds additional headers for CORS |
EmptyStringToNull | Converts the empty strings from request as null |
SpoofFormMethod | Replaces the HTTP verb from _method value |
JsonHeaders | Changes content response to application/json |
TrimString | Trims the strings from an incoming request |
NOTE: All of the HTTP middlewares above are implemented in the v0.4.1
of PSR-15.