Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Laravel 5 Essentials

You're reading from   Laravel 5 Essentials Explore the fundamentals of Laravel, one of the most expressive and robust PHP frameworks available

Arrow left icon
Product type Paperback
Published in Apr 2015
Publisher Packt
ISBN-13 9781785283017
Length 144 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Martin Bean Martin Bean
Author Profile Icon Martin Bean
Martin Bean
Arrow right icon
View More author details
Toc

Eloquent conventions

Eloquent has some conventions, which, if followed, will make your life easier. This approach is known as convention over configuration, which means, if you follow these conventions, you will have to do very little configuration for things to "just work".

An Eloquent model is contained in a single class and is the "studly-cased", singular version of your database table's name. Studly-case is similar to camel-casing, but the first letter is uppercase as well. So if you have a database table called cats, then your model class will be called Cat.

There is no set place in the filesystem to place your Eloquent models; you are free to organize them as you see fit. You can use an Artisan command to create a model stub (a simple class with the basic structure of an Eloquent model). The command is:

$ php artisan app:model Cat

By default, Artisan places new model classes in the app directory. You are free to move your model classes and store them in whatever...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image