Support the ongoing development of Laravel.io →
Configuration Database Eloquent
Last updated 2 years ago.
0

Out of curiosity / frustration, made a new laravel copy,

  • php artisan make:model Artist -m

makes a migration with the following:

public function up()
    {
        Schema::create('artists', function (Blueprint $table) {
            $table->increments('id');
            $table->timestamps();
        });
    }

Since it automagically ( :-( ) renames model Artist to artists, i can imagine someplace in the code where this happens as well with my inserts, even though i renamed the migration files... what is my next step, where can i read a bit more about this?

0

It doesn't rename anything. If you don't set the $table property on the model it will use the plural form of the class name for the table name of the model.

This is in the eloquent docs.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

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.