I am working on Laravel 5.4 and i have a question about ORM. Why the behaviour of this two samples of codes send differents informations :
Foo::whereId(13632)->first(); => null
DB::table('foo')->where('id', '=', 13632)->first(); => Foo{...}
My class Foo :
class Foo extends Model
{
protected $table = 'foo';
...
}
If i try do to this in my db (SQL) :
SELECT * FROM `doctors` WHERE `id` = 13632
I got the line with all the datas.
Thank you.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire