What is the correctly table name of this table in Laravel 3/4?
Structure
image_projects (id, project_id, image, ext, size, created_at, updated_at, active)
image_projects
imageprojects
imageProjects
And, how I can create the Model?
app/models/image_projects.php
app/models/imageprojects.php
app/models/imageProjects.php
app/models/image/projects.php
app/models/projects/image.php
It makes no difference what you name your table, as long as you then name the file & class in singular form, with the class name starting with an uppercase letter.
You can use any of the following options:
Table name:
image_projectsFile name:
ImageProject.phpClass name:
ImageProjectTable name:
imageprojectsFile name:
Imageproject.phpClass name:
ImageprojectTable name:
imageProjectsFile name:
ImageProject.phpClass name:
ImageProjectIn this case you’ll have to set the
$tableproperty yourself.Remember: If you don’t name your class in singular form of what you name your table, you’ll have to manually set it in your model: