DEV Community

Discussion on: What's your go-to stack these days?

Collapse
 
matthewbdaly profile image
Matthew Daly

Generally Laravel on the back end, with React on the front end.

I'd prefer to use Postgres rather than MySQL or MariaDB, but it tends not to be possible because the PHP community is very MySQL-focused. I also tend to use Redis as my cache and queue backend.

Collapse
 
nickyoung profile image
Nick Young

I have been really interested in getting deeper into Laravel. I heard that it meshes really well with Vue (which I already know) so it intrigued me more. I am also about to learn React. Have you tried using Laravel with both Vue and React and if so, what is your reasoning for your preference being React?

Collapse
 
ekafyi profile image
Eka • Edited

I just want to add that Laravel comes with its webpack-based build tool: laravel.com/docs/7.x/mix

The default installation is configured for Vue, but you can change it to React easily: laravel.com/docs/7.x/frontend#usin...

As it's really just webpack, you can even use Svelte with relatively simple setup. Basically you can bring any major UI/frontend stack that you are most comfortable with to use with Laravel.

Thread Thread
 
matthewbdaly profile image
Matthew Daly

Mix can also be used outside the context of Laravel. I use it on a legacy Zend 1 project I maintain where I've been using React for new front-end work.

The only thing that required more work is versioning - I had to roll my own solution for that.

Collapse
 
madza profile image
Madza

Laravel and Vue are awesome, plus both come with some of the best docs around.. So it's a win-win if you need to look-up smth ;)

Thread Thread
 
nickyoung profile image
Nick Young

Very true, the Vue documentation is really thorough and I have noticed the same with my experience with Laravel so far :) Always a huge plus when getting into something new!

Collapse
 
matthewbdaly profile image
Matthew Daly

The default front-end toolset for Laravel uses Vue, so it's quicker to get working with Vue in Laravel than any other front end framework.

I have tried Vue a couple of times, and the issues I have with it are as follows:

  • Vue has a lot of special syntax for templating, while React is basically just Javascript and HTML with a handful of minor changes to attribute names so they don't conflict with Javascript reserved words, making it easier to remember
  • I've always had a strong affinity for Javascript, and React embraces the functional nature of Javascript to a much greater extent than Vue, particularly since the advent of the hooks API. A component is effectively just a Javascript function that returns HTML.
  • React is conceptually simpler. There's no two-way binding - instead you just pass props down from one component to another (or using context to share data with multiple components within a tree), making it fairly straightforward to understand what's going on
  • It feels more natural to make your components more granular in React than in Vue, and thus they are potentially easier to maintain
  • Vue feels less philosophically consistent than React to me. As noted above, React has an emphasis on functional programming, as opposed to OOP, and sticks pretty rigorously to it (they notably removed mixins because they caused certain problems, and encouraged the use of higher order components in their stead), while Vue is more forgiving.

I will concede that React is harder for front-end developers who don't necessarily know Javascript all that well to pick up, though.

Thread Thread
 
nickyoung profile image
Nick Young

Wow, awesome reply. Thank you for taking the time to respond :)