Support the ongoing development of Laravel.io →
Requests Views Architecture
Last updated 2 years ago.
0

Take a look at this page and familiarize yourself with the Laravel IoC container: http://laravel.com/docs/4.2/ioc What you're describing is a singleton, so read that section carefully. You could then reference it from the application facade or using dependency injection in a controller constructor.

When you create an Eloquent model it will look for the plural form of the class name so if the class is named 'Instagram' then it will look for a table named 'instagrams' in your database. I don't know off the top of my head if it will throw an error if the model class isn't being used in any other code. You can specify the name of the table by adding a protected property named 'table' (see http://laravel.com/docs/4.2/eloquent#basic-usage).

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

raphadko raphadko Joined 13 Jul 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.