jmrufo
Problem editing filtered record
Hello
I have used the modifyQueryUsing() function on the table and the records it displays for each user are correct, however when editing a record the information it loads is still incorrect, that is, it always loads the information from the first record shown regardless of the one you select.
Example:
->modifyQueryUsing(function (Builder $query) {
if (Auth::user()->hasRole('panel_user')) {
return $query->where('modality', 'TF');
} elseif (Auth::user()->hasRole('panel_user_presencial')) {
return $query->where('modality', '=','P')->Orwhere('modality', '=', 'M')->Orwhere('modality', '=', 'AV');
}
})
I have observed that the id of the record that is loaded for editing is correct but the information is not.
What could be the cause of this?
Regards.
8 replies