Laravel x Cakephp

Asked

Viewed 743 times

1

I’m starting at Laravel (5.x), but I’ve had years of Cakephp experience and I’d like to clear up some doubts, because I haven’t found anything like this on the Internet:

1) Can I only create models, controllers and the like with the Artisan command? Or can I do otherwise?

2) After all, what is Artisan and what its ability (only create models and controllers or have something else)?

3) In Cakephp I worked with Elements, that is, small snippets of code that I requested in the view to compose the layout (e.g.: Middle, footer, side bar, menu, Readcrumbs, etc.), even in cake there is a default Layout, where it contained header, head, footer and the like, Since this default layout did not need to be "set" in controllers, it already renders by default. Finally, the views contained only the content/kernel/information. The doubt is:

3.1) Is there such a Elements in Laravel? If so, how do I do? 3.2) There is this default layout to create the common parts and work with the views only for the kernel/content?

That’s all the doubt for now. If in Laravel this layout context does not exist, please tell me what would be the best way to build a flexible layout.

1 answer

2


  1. No! Artisan is just an aggregator of commands that help you with some project tasks. See more.

  2. As stated in topic 1, Artisan is a command aggregator. You can use it to create parts of your application and do other tasks such as clearing the application cache, migrating to the database, and more. You can also create custom commands with it. More information about Artisan.

  3. The Laravel doesn’t provide natively something like the Elements which exist in Cakephp, however, it comes with a template system called Blade where you can create your own "Elements" and make templates very flexible.

As a support material (very good), you can see the video lessons from Laracasts with its fundamentals. It will clarify you quite a few questions about all these questions you raised in addition to teaching you how to make some simple applications.

  • Very good chorajunior. Thank you, mto enlightening

Browser other questions tagged

You are not signed in. Login or sign up in order to post.