Generators and helpers for the Slytherin framework

Provides generators, helpers, and utilities for rapid prototyping of Slytherin-based applications.

View source code on Github

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.

Installation

Install Weasley via Composer:

$ composer require rougin/weasley

Features

Generators

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.

CommandDescription
make:controllerCreates a new HTTP controller class
make:integrationCreates a new Slytherin Integration class
make:middlewareCreates a new v0.4.1 of PSR-15 middleware class
make:validatorCreates a new validator class based on Valitron

HTTP Controllers

ControllerDescription
JsonControllerProvides methods for RESTful APIs in JSON format

Integrations

IntegrationDescription
SessionIntegrationAn implementation of SessionHandlerInterface

Illuminate (Laravel's individual components)

IntegrationDescription
DatabaseIntegrationBased on illuminate/database (Eloquent)
PaginationIntegrationBased on illuminate/pagination
ViewIntegrationBased on illuminate/view (Blade)

NOTE: The mentioned integrations above needs to include their required dependencies first.

HTTP Middlewares

MiddlewareDescription
CrossOriginHeadersAdds additional headers for CORS
EmptyStringToNullConverts the empty strings from request as null
SpoofFormMethodReplaces the HTTP verb from _method value
JsonHeadersChanges content response to application/json
TrimStringTrims the strings from an incoming request

NOTE: All of the HTTP middlewares above are implemented in the v0.4.1 of PSR-15.