Generators and helpers for the Slytherin framework.

v0.6.3 2018-04-20 00:41 UTC

This package is auto-updated.

Last update: 2021-07-15 17:51:17 UTC


Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

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

HTTP Controllers

Controller Description
JsonController Provides methods for RESTful APIs in JSON format


Integration Description
SessionIntegration An implementation of SessionHandlerInterface

Illuminate (Laravel's individual components)

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.

HTTP Middlewares

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.


Please see CHANGELOG for more information what has changed recently.


$ composer test



The MIT License (MIT). Please see LICENSE for more information.