Did you run the migration?
php artisan migrate
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I am trying to follow through with Eloquent 101.
shh into vagrant cd Code/projectone php artisan make:migration food --create="food"
(open food file) In the good file add the tables
$table->text('vegetables'); $table->text('fruit'); $table->text('grains');
php artisan make:model food php artisan tinker $food = new App\food; $food->vegetables ="eggplant"; $food->fruit="orange"; $food->grains="bread"; $food->save();
Illuminate\Database\QueryException with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'homestead.testones' doesn't exist (SQL: insert into testones (vegetables, fruit, grains, updated_at, created_at) values (eggplant, orange, bread, 2016-01-08 23:03:01, 2016-01-08 23:03:01))'
What did I miss, in exactly that order from scratch?
You created a table called 'food' but Laravel is looking for 'foods.' The name has to be exact. By convention, Laravel will assume that a model name is the singular of the database name. For example, if the model is called User, the database table would be called users. In your case, if the model is called Food, Laravel will look for a table called foods. To override this, set the table property in your model.
protected $table = 'food';
Please or to participate in this conversation.