mawuekom/laravel-fastkit

Utils to deal quickly and easily with laravel or lumen project

dev-main 2021-06-03 15:27 UTC

This package is auto-updated.

Last update: 2024-05-29 05:26:35 UTC


README

A useful toolkit for a quick start with laravel or lumen... It can also help you in your rest api development with these last

Installation

You can install the package via composer:

composer require mawuekom/laravel-fastkit

This package use :

Check on it for good installation

Usage

Laravel

Go to config/app.php, and add this in the providers key

'providers' =>
    ...
    Mawuekom\Fastkit\FastkitServiceProvider::class
    ...
];

Publish package config

php artisan vendor:publish --provider="Mawuekom\Fastkit\FastkitServiceProvider"

Go to App\Http\Kernel.php, and add this in the specified key

protected $routeMiddleware = [
    ...
    'cors' => Fruitcake\Cors\HandleCors::class
    'sanitized_request' => \Mawuekom\Fastkit\Http\Middleware\SanitizedRequest::class,
    'api_localization' => \Mawuekom\Fastkit\Http\Middleware\ApiLocalization::class,
    'check_id' =>  \Mawuekom\Fastkit\Http\Middleware\CheckResourceID::class
    ...
];

Lumen

Go to bootstrap/app.php, and add this in the specified key

$app->middleware([
    ...
    Fruitcake\Cors\HandleCors::class,
    ...
]);

$app->routeMiddleware([
    ...
    'cors' => Fruitcake\Cors\HandleCors::class
    'sanitized_request' => \Mawuekom\Fastkit\Http\Middleware\SanitizedRequest::class,
    'api_localization' => \Mawuekom\Fastkit\Http\Middleware\ApiLocalization::class,
    'check_id' =>  \Mawuekom\Fastkit\Http\Middleware\CheckResourceID::class
    ...
]);

// Add provider also
$app->register(Mawuekom\Fastkit\FastkitServiceProvider::class);

Once done, enjoy it

Report bug

Contact me on Twitter @ephraimseddor

License

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