Hi there,

Today, I will share tip how to use router model bind of Phalcon, if you are using Laravel maybe you would like this feature.

In Phalcon you just to using conversors: Conversors allow you to freely transform the route’s parameters before passing them to the dispatcher. The following examples show how to use them:

router->add('/user/{user}', [
                'controller' => 'index',
                'action'     => 'test',
            ])->convert('user', function ($id) {
                return User::find($id)->getFirst();

And into controller you just do some thing like this

    public function testAction(User $user)

Note that: this tip I refer to here https://github.com/phalcon/cphalcon/issues/11267#issuecomment-169363049