Donkarnash Donkarnash - 11 months ago 48
PHP Question

Which version of Laravel to use LTS or latest - developer support commitment for 5 years atleast?

As a developer I have to make a upfront commitment for 5 years support for a new Laravel project.

My question is - whether I should use Laravel's Long Term Support (LTS) version only?

What could be the potential pitfalls with regards to the support commitment if I use the latest Laravel 5.3 instead of the LTS version?

Any information regarding points to be considered like pros/cons with regards to the support commitment for 5 years when using the latest Laravel version versus using LTS version would help me make a correct decision.

Mjh Mjh
Answer Source

To keep your application framework-agnostic, or to make it easier to swap out or not depend on the framework, the approach which worked the best for me was to isolate my business logic in separate libraries.

I handle those libraries using GITLab server, and I expose them to my composer via satis.

If you use Laravel's routing to map request to a controller, then you can use your library inside that controller and perform the rest of the work.

Constructing your app this way lets you:

  • isolate business logic
  • rely on framework to provide correct input since you can use middleware to filter out requests that don't fit.
  • have it easier when it comes to swapping the framework out
  • you're using composer, which lets you easily manage library and framework version(s)

This way, you can upgrade your app bit by bit as time goes by, you don't have to rely on having only one framework version forever, without being able to use newer releases.

Good luck with your project!