# Controllers and Database ORM

**URL:** <https://discourse.slimframework.com/t/controllers-and-database-orm/154>\
**Category:** Questions\
**Created:** [April 19, 2016, 7:55pm UTC](https://discourse.slimframework.com/t/controllers-and-database-orm/154 "2016-04-19T19:55:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndersonDev](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/andersondev/32/50_2.png) [@AndersonDev](https://discourse.slimframework.com/u/AndersonDev)\
**Post date:** [April 19, 2016, 7:55pm UTC](https://discourse.slimframework.com/t/controllers-and-database-orm/154/1 "2016-04-19T19:55:49Z")

</div>

Hi. Here are some examples for using **controllers** except one on the site? And how to include many php files to slim correctly (10 controllers in different php files)?

And may you recommend some Database ORM for slim. Some easy to use with examples.

Thanks!!!

---

<div class="post-metadata">

**Author:** ![akrabat](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/akrabat/32/9_2.png) [@akrabat](https://discourse.slimframework.com/u/akrabat)\
**Post date:** [April 19, 2016, 8:05pm UTC](https://discourse.slimframework.com/t/controllers-and-database-orm/154/2 "2016-04-19T20:05:59Z")

</div>

Have a look at [https://github.com/akrabat/slim-bookshelf](https://github.com/akrabat/slim-bookshelf).

---

<div class="post-metadata">

**Author:** ![JoeBengalen](https://avatars.discourse-cdn.com/v4/letter/j/b5e925/32.png) [@JoeBengalen](https://discourse.slimframework.com/u/JoeBengalen)\
**Post date:** [April 19, 2016, 8:06pm UTC](https://discourse.slimframework.com/t/controllers-and-database-orm/154/3 "2016-04-19T20:06:03Z")

</div>

Example application: [https://github.com/akrabat/slim-bookshelf](https://github.com/akrabat/slim-bookshelf)  
Correct way to include class files is using an autoloader, composer for example (also used in the bookshelf above).

Which ORM is entirely up to you. None works better of worse with Slim.  
Heared some good things about [eloquent](https://laravel.com/docs/5.0/eloquent) and [spot2](https://github.com/vlucas/spot2), but I never use an ORM.

---

<div class="post-metadata">

**Author:** ![AndersonDev](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/andersondev/32/50_2.png) [@AndersonDev](https://discourse.slimframework.com/u/AndersonDev)\
**Post date:** [April 19, 2016, 8:21pm UTC](https://discourse.slimframework.com/t/controllers-and-database-orm/154/4 "2016-04-19T20:21:01Z")

</div>

Cool!  
I never use they too. However I have toooo much sql code. And many validations. I need they only for sending by json and have only backend for AngularJS.

---

<div class="post-metadata">

**Author:** ![AndersonDev](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/andersondev/32/50_2.png) [@AndersonDev](https://discourse.slimframework.com/u/AndersonDev)\
**Post date:** [April 19, 2016, 8:22pm UTC](https://discourse.slimframework.com/t/controllers-and-database-orm/154/5 "2016-04-19T20:22:01Z")

</div>

What about ORM? You recommend Eloquent? Or nothing just SQL
