
Ask HN: What non PHP framework resembles the structure/deployment of Laravel/Yii - steven_braham
PHP has been my main language for years, but I want to learn other languages to create web apps. The thing I like the most of PHP is how easy it is to deploy and develop an application. When deploying your app, you only have to update the files with a file transfer or a deployment script, because a PHP interpreter is always running.<p>Furthermore, all PHP frameworks like Yii, Laravel and CodeIgniter follow the same conventions for structuring a project.<p>I&#x27;ve tried to learn Django and like the syntax. However, I don&#x27;t like the idea that a project contains multiple apps. I prefer to have large applications that do multiple things. Also, the whole template&#x2F;view part is a bit confusing for me.<p>I&#x27;m curious what other platforms&#x2F;languages are the most similar to the structure and deployment of Yii and Laravel projects.<p>The Java play framework seems like an interesting option.
======
mtmail
Ruby on Rails. You'll immediately notice an 'app' directory. Resources are in
app/assets, controllers in app/controllers, models in app/models and views in
app/views. There's a routes.rb file and a command line interface ('rake
routes' does the same as 'php artisan routes:list', 'rake db:migrate' is the
same as 'php artisan migrate').

While you can deploy Rails by just copying files (it will reload classes and
recompile assets on page refresh whenever possible) it's still a best practice
to have the dev and production environment different.

~~~
steven_braham
Damm RoR is nearly Laravel with a different syntax. Development and deployment
is also very easy. I was always wary of RoR, because I read online that it's
so good at simplifying and abstracting stuff, it can become a black box that
is hard to debug.

However, apart from that, this is exactly what I sought. Thank you for making
me reconsider Ruby :)

------
rubyfan
See also
[https://news.ycombinator.com/item?id=14974767](https://news.ycombinator.com/item?id=14974767)

~~~
steven_braham
I saw that thread before, but nothing really appealed to me.

~~~
rubyfan
Same, except Laravel was new to me in that thread. Looks pretty similar to
what you get with Rails but for PHP.

Given the criteria I laid out in that post it looks viable. I’m honestly
surprised since I left PHP for Ruby about 12-13 years ago. I think Cake was
the wannabe at that point which must have been PHP 4 or 5. There was much I
disliked then but Laravel seems better.

So I’ll pose the question, does Laravel have a compelling feature which you
think makes it better than Rails or do you think they’re about even?

~~~
steven_braham
One of the things I like really well about Laravel is that it integrates with
modern front-end development tools and frameworks.

They have an excellent asset manager called Elixir that acts as a wrapper for
Gulp. You can even use it without Laraval. In your gulpfile, you just have to
require Elixir and tell it what are the source and output directories. It even
has an option to automatically suffix a random hash to your app.js and
style.css for cache busting.

In your template, you only have to include the style.css or app.js and it will
auto inject the latest version like this: <link rel="stylesheet" href="{{
elixir('css/all.css') }}"> will become <link rel="stylesheet"
href="/assets/all-blabla.css">.

You can read more about it here:
[https://laravel.com/docs/5.3/elixir](https://laravel.com/docs/5.3/elixir)

The Framework also has a lot of build in stuff to simplify connecting Vue.js
components to your PHP backend.

Laravel is mostly built on the idea that everything is loosely coupled.

For example, in Yii2 (another popular php framework) everything is built
around the Yii ORM and routing system. Laravel strictly separates all
components.

Apart from these two things, there really aren't many benefits that make
Laravel stand out. I have worked a lot with both the Yii platform and the
Laravel platform and it's mostly a matter of preference.

Laravel also has an official stripped down derivative called Lumen. It's meant
for building API's.

