Search code examples
phplaravellumen

Adding helpers in lumen


I am working Lumen for the first time and using v 6.0.

I am not able to use any of the helpers available in laravel like resource(), bcrypt() and may be anything in here. Throws me

"message":"Call to undefined function App\Http\Controllers\bcrypt()"

message. I have tried adding "laravel/helpers": "^1.2", but no luck. can someone throw some light on this. anyway I can get this running.


Solution

  • Lumen is a micro-framework by Laravel, this means a lot of Laravel helpers and components is not available in Lumen by default.

    If you are developing a stateless application, Lumen could be very useful as it's a very fast and light weight framework which focusing on JSON APIs from version 5.2

    Only Stateless APIs

    Lumen 5.2 represents a shift on slimming Lumen to focus solely on serving stateless, JSON APIs. As such, sessions and views are no longer included with the framework. If you need access to these features, you should use the full Laravel framework.

    of course all Lumen features lists available in official documentation including the encryption, authentication and etc.

    you may want take a look at release note and pick your choice between Lumen or Laravel: https://lumen.laravel.com/docs/master