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

You should use migrations in order to manipulate your database schema.

Last updated 2 years ago.
0

Thank you. I used migrations and it worked. But now, I want to use a object User in Models but I'm confusing :))

Last updated 2 years ago.
0

User is your model !

Last updated 2 years ago.
0

yes. I have a file User.php and it have code :

<?php class User extends Eloquent { public $table="users"; } but I wonder why the function save() not run?
Last updated 2 years ago.
0

What's the error ?

Last updated 2 years ago.
0

This is the notice error: Call to undefined method User::save().

Last updated 2 years ago.
0

Try creating the object first:

$user = new User;
$user->field_name = 'value';
$user->save();
Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

dinhha2075 dinhha2075 Joined 22 Jul 2014

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.