I have a some problem… ORM
When I use
php artisan tinker,
use App\Models\User
$u = new User();
$u->title = 'sale';
$u->content = 'auto ...';
$u->price = 2500;
HERE ARE GOOD EVERYTHING, BUT…
when I type command
$u->save();
I see
IlluminateDatabaseQueryException SQLSTATE[HY000]: General error: 1 no such table: users (SQL: insert into "users" ("title", "content", "price", "updated_at", "created_at") values (sale, auto …, 2500, 2024-10-30 14:31:15, 2024-10-30 14:31:15)).
What can it be? All migrations is good, I have a table sqlite.
I have done everything from book, just change names of models etc
Laraver 9, PHP 8.3, Ubuntu, local
I wanna create my own project for pet project… I check it app DB Browser for SQLite.
2
Answers
The error suggest that the users table doesn’t exist in your database
here are some reasons
so check your DB tale and provide a screen and more details if not a case