Q: Laravel: SQLSTATE[23000] error with dataTables Why do i get this error? I have the right relationships and in tinker, it works really well, do u guys have any idea about this?
Tinker:

Controller:
$emp = Empresa::find($request->empresa_id);
$mov = $emp->movimientos()->where('linea_id', intval($request->id_caso))->with('producto_nombre', 'costo_promedio');
return DataTables::of($mov)->make(true);

Error:

Table structure:

Thx for the help.

A: ambiguous error occurs when there are multiple columns with the same name and you dont specified its table
since there are multiple table and have a column with the same name in your query you must specify the table name in your condition 
$emp = Empresa::find($request->empresa_id);
$mov = $emp->movimientos()->where('movimiento.linea_id', intval($request->id_caso))->with('producto_nombre', 'costo_promedio');
return DataTables::of($mov)->make(true);

