Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Create Laravel Case Middleware in phalcon php

Hi Guys.

I wanna to be create laravel case middleware. You know that laravel has a specific folder for middlewares that you can bind them to any route groups.

how do it works on phalcon php?

Hi I don't know Laravel but here you can use Middleware and group routes

Good luck

Hi I don't know Laravel but here you can use Middleware and group routes

Good luck

thanks for your tips, but can i bind middleware to route groups?

Hi I don't know Laravel but here you can use Middleware and group routes

Good luck

and also i forgot to explain that i use micro phalcon framework application. sorry about that.



22.2k
Accepted
answer

You can access from middleware to anything passing the Di conteiner like parameter

$app = new Phalcon\Mvc\Micro();

$app->before(
    function () use ($app) {
        // do what you want
    }
);