✍️ Written by Hovah Yii
I came from a JavaScript background. The framework I used the most nowadays is NextJS and the language, TypeScript. Here are the things that I found different using Laravel compared to Next JS:
- In Next JS, does not impose conventions for the MVC model, so it's totally up to the development team to decide what architecture to adopt and how to implement and organise it. However, in Laravel, it is well structured in MVC. The MVC is created by default and you do not have to create the model on your own.
- Laravel allows the user to write in original HTML, CSS, SCSS and even call the script tag when one needs to import some javascript library from nowhere. In Next JS, everything written has to be in JavaScipt (.js) or TypeScript (.ts). The CSS is usually written in global.css and has to be imported to the app.js file to make the CSS work.
- Compared to Next JS, the dependency manager for Laravel is Composer. While in Next JS, we have many alternatives like Brew, Yarn, NPM to install the dependencies.
The things I do not like about the Laravel as a JavaScript developer:
- Laravel does not support auto or fast refresh. However, Next JS, it has a feature called fast refresh which gives the developer instantaneous feedback on edits made to the React components.
- Laravel framework file size is big compared to Next JS.
- Laravel is not beginner-friendly as there is a lot of folder, command lines you need to learn in order to use Laravel compared to Next JS which is easier to navigate and the file structure is a lot simple and more precise.
While a lot of developers claimed that PHP is gonna die in Web 3.0 or in the current web development world, the matter of fact is PHP still helps a lot of developers put food on their tables. There are pros and cons in abducting a framework. My guess is just used what you like; and as long as it helps you to achieve your goals, it will always be a good framework.