app/Http/Controllers/Compras_OtController.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function index()
    {
        $compra= Compras_ot::with('ot','area','tipo_compra','divisa','estado')->get();
        return response()->json($compra);
    }
public function index ( ) { $ compra = Compras_ot :: with ( 'ot' , 'area' , 'tipo_compra' , 'divisa' , 'estado' ) -> get ( ) ; return response ( ) -> json ( $ compra ) ; }
Display a listing of the resource.
Display a listing of the resource .