$def = Def::where("abc_id", $abc->id)
or if there is a "hasOne(Def)" or "hasMany(Def)" relationship defined in Abc model
$def = $abc->def
afte find a row we have to update a row... but if i use where method..then we can not use update method like for that we have to use find methd. $def->update($fields); if i use where method then error is HTTPRequest Error :: 500: {"error":{"type":"Symfony\Component\Debug\Exception\FatalErrorException","message":"Call to undefined method Illuminate\Database\Eloquent\Collection::update()","file":"D:\wamp\www\doc2door\app\D2D\Repositories\PatientRoutineRepository.php","line":40}}:error
Thanks HARSH SHAH
$def = Def::where("abc_id", $abc->id)->first()
this of course means, that there is (or shoukd be) one-to-one relationship between abc and def
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community