jeffcj's avatar

New project question. Laravel + ??JS

Hello all! I'm coming to Laravel from Yii/Yii2 (mostly). I've dabbled in a few PHP frameworks over the years. The same could be said for JavaScript--Angular2, Ember, etc (very limited experience with those).

I'm starting a new project and I find myself in an "analysis paralysis" scenario. I know I want to learn/utilize Laravel for this project. I also want to have a good JS framework or library available to handle some of the view widgets, perhaps making some pages load content dynamically (think: product lists loading into an eCommerce page). I think, for example, pagination between product listings works well when loaded client side and makes for a more fluid user experience.

Requirements are relatively simple (which is why I'm using this as a learning exercise for Laravel and whatever else I come up with). This might be too much info, but here's my general plan for this project for some context: Simple site components: Home, About, Contact (contact form) (optional) Basic blog component Scheduling Component: UI to allow users to book appointments based on business availability (with accompanying admin section).

Simple eCommerce functionality to view products by category. I'll be integrating SnipCart so that will take care of the actual shopping cart heavy lifting (checkout flow, shipping, tax, payment, etc.)

Things I've considered: Angular2 SPA - Potentially overly complicated for this use case. Also, still some SEO considerations. EmberJS SPA - Same as Angular from an SEO consideration perspective. Laravel + jQuery where needed - Couldn't get much more straightforward. Not learning anything new on the JS side here though. :)

I guess my question is, what would you use in this stack? Laravel + ? if you were starting a new project like this today. Fortunately, this is not a time sensitive project so I can use the opportunity to learn along the way. Thanks in advance! Jeff

0 likes
3 replies
kobear's avatar

I think most on here would say to look at Vue.js. There are lots of videos on this site, and Laravel 5.3 has some boilerplate stuff for building out Vue.js stuff

1 like
jeffcj's avatar

Thanks @kobear, I was just noticing that Vue seems to be popular here. Looking into it a bit further.

Aferz29's avatar

While Vue.js is a good option (specially for the content uploaded here) i would go with React.js + Redux pattern (Optional). Why ?

Advantages

  • The way React handle the components is just amazing, easy and clear.
  • Virtual DOM gives you an extra boost when re-rendering your views (A bit faster than Vue & Angular1/2).
  • It gives you the power to learn pure javascript in deep (ES6 included).
  • (Optional) Redux pattern for your application state (This is more for SPA, but whatever).
  • You have lots of tutorials and examples. (Here, in Laracast, and outside)
  • Is easier to learn. You just have to learn Javascript!

Disadvantages

  • .jsx syntax looks soooooo weird the first times you work with it, but you get used to it quickly and see the benefits.
  • Redux pattern is harder to learn and it's a bit verbose. (But totally necessary)

Of course, this is up to you and i have to say Vue JS is a really good framework that i enjoyed, but honestly i prefer the React way.

Cheers.

Please or to participate in this conversation.